if(!String.prototype.endsWith){ String.prototype.endsWith=function(search, this_len){ if(this_len===undefined||this_len > this.length){ this_len=this.length; } return this.substring(this_len - search.length, this_len)===search; };} if(window.NodeList&&!NodeList.prototype.forEach){ NodeList.prototype.forEach=Array.prototype.forEach; } if(!String.prototype.trim){ String.prototype.trim=function(){ return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); };} (function($, sr){ 'use strict'; var debounce=function(func, threshold, execAsap){ var timeout; return function debounced(){ var obj=this, args=arguments; function delayed(){ if(!execAsap) func.apply(obj, args); timeout=null; } if(timeout&&timeout.val) theme.deleteTimeout(timeout); else if(execAsap) func.apply(obj, args); timeout=theme.requestTimeout(delayed, threshold||100); };}; jQuery.fn[sr]=function(fn){ return fn ? this.on('resize', debounce(fn)):this.trigger(sr); };})(jQuery, 'smartresize'); jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function(x, t, b, c, d){ return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeOutQuad: function(x, t, b, c, d){ return -c *(t /=d) *(t - 2) + b; }, easeInOutQuart: function(x, t, b, c, d){ if(( t /=d / 2) < 1) return c / 2 * t * t * t * t + b; return -c / 2 *(( t -=2) * t * t * t - 2) + b; }, easeOutQuint: function(x, t, b, c, d){ return c *(( t=t / d - 1) * t * t * t * t + 1) + b; }}); (function($){ $.fn.visible=function(partial, hidden, direction, container){ if(this.length < 1) return; var $t=this.length > 1 ? this.eq(0):this, isContained=typeof container!=='undefined'&&container!==null, $w=isContained ? $(container):$(window), wPosition=isContained ? $w.position():0, t=$t.get(0), vpWidth=$w.outerWidth(), vpHeight=$w.outerHeight(), direction=(direction) ? direction:'both', clientSize=hidden===true ? t.offsetWidth * t.offsetHeight:true; if(typeof t.getBoundingClientRect==='function'){ var rec=t.getBoundingClientRect(), tViz=isContained ? rec.top - wPosition.top >=0&&rec.top < vpHeight + wPosition.top : rec.top >=0&&rec.top < vpHeight, bViz=isContained ? rec.bottom - wPosition.top > 0&&rec.bottom <=vpHeight + wPosition.top : rec.bottom > 0&&rec.bottom <=vpHeight, lViz=isContained ? rec.left - wPosition.left >=0&&rec.left < vpWidth + wPosition.left : rec.left >=0&&rec.left < vpWidth, rViz=isContained ? rec.right - wPosition.left > 0&&rec.right < vpWidth + wPosition.left : rec.right > 0&&rec.right <=vpWidth, vVisible=partial ? tViz||bViz:tViz&&bViz, hVisible=partial ? lViz||rViz:lViz&&rViz; if(direction==='both') return clientSize&&vVisible&&hVisible; else if(direction==='vertical') return clientSize&&vVisible; else if(direction==='horizontal') return clientSize&&hVisible; }else{ var viewTop=isContained ? 0:wPosition, viewBottom=viewTop + vpHeight, viewLeft=$w.scrollLeft(), viewRight=viewLeft + vpWidth, position=$t.position(), _top=position.top, _bottom=_top + $t.height(), _left=position.left, _right=_left + $t.width(), compareTop=partial===true ? _bottom:_top, compareBottom=partial===true ? _top:_bottom, compareLeft=partial===true ? _right:_left, compareRight=partial===true ? _left:_right; if(direction==='both') return !!clientSize&&(( compareBottom <=viewBottom)&&(compareTop >=viewTop))&&(( compareRight <=viewRight)&&(compareLeft >=viewLeft)); else if(direction==='vertical') return !!clientSize&&(( compareBottom <=viewBottom)&&(compareTop >=viewTop)); else if(direction==='horizontal') return !!clientSize&&(( compareRight <=viewRight)&&(compareLeft >=viewLeft)); }};})(jQuery); window.theme={}; (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { rtl: js_porto_vars.rtl=='1' ? true:false, rtl_browser: $('html').hasClass('browser-rtl'), ajax_url: js_porto_vars.ajax_url, request_error: js_porto_vars.request_error, change_logo: js_porto_vars.change_logo=='1' ? true:false, show_sticky_header: js_porto_vars.show_sticky_header=='1' ? true:false, show_sticky_header_tablet: js_porto_vars.show_sticky_header_tablet=='1' ? true:false, show_sticky_header_mobile: js_porto_vars.show_sticky_header_mobile=='1' ? true:false, category_ajax: js_porto_vars.category_ajax=='1' ? true:false, prdctfltr_ajax: js_porto_vars.prdctfltr_ajax=='1' ? true:false, container_width: parseInt(js_porto_vars.container_width), grid_gutter_width: parseInt(js_porto_vars.grid_gutter_width), screen_lg: parseInt(js_porto_vars.screen_lg), slider_loop: js_porto_vars.slider_loop=='1' ? true:false, slider_autoplay: js_porto_vars.slider_autoplay=='1' ? true:false, slider_autoheight: js_porto_vars.slider_autoheight=='1' ? true:false, slider_speed: js_porto_vars.slider_speed ? js_porto_vars.slider_speed:5000, slider_nav: js_porto_vars.slider_nav=='1' ? true:false, slider_nav_hover: js_porto_vars.slider_nav_hover=='1' ? true:false, slider_margin: js_porto_vars.slider_margin=='1' ? 40:0, slider_dots: js_porto_vars.slider_dots=='1' ? true:false, slider_animatein: js_porto_vars.slider_animatein ? js_porto_vars.slider_animatein:'', slider_animateout: js_porto_vars.slider_animateout ? js_porto_vars.slider_animateout:'', product_thumbs_count: js_porto_vars.product_thumbs_count ? js_porto_vars.product_thumbs_count:4, product_zoom: js_porto_vars.product_zoom=='1' ? true:false, product_zoom_mobile: js_porto_vars.product_zoom_mobile=='1' ? true:false, product_image_popup: js_porto_vars.product_image_popup=='1' ? 'fadeOut':false, animation_support: !$('html').hasClass('no-csstransitions')&&window.innerWidth > 767, owlConfig: { rtl: js_porto_vars.rtl=='1' ? true:false, loop: js_porto_vars.slider_loop=='1' ? true:false, autoplay: js_porto_vars.slider_autoplay=='1' ? true:false, autoHeight: js_porto_vars.slider_autoheight=='1' ? true:false, autoplayTimeout: js_porto_vars.slider_speed ? js_porto_vars.slider_speed:7000, autoplayHoverPause: true, lazyLoad: true, nav: js_porto_vars.slider_nav=='1' ? true:false, navText: ["", ""], dots: js_porto_vars.slider_dots=='1' ? true:false, stagePadding:(js_porto_vars.slider_nav_hover!='1'&&js_porto_vars.slider_margin=='1') ? 40:0, animateOut: js_porto_vars.slider_animateout ? js_porto_vars.slider_animateout:'', animateIn: js_porto_vars.slider_animatein ? js_porto_vars.slider_animatein:'' }, sticky_nav_height: 0, is_device_mobile: /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent||navigator.vendor||window.opera)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(( navigator.userAgent||navigator.vendor||window.opera).substr(0, 4)), getScrollbarWidth: function(){ if(this.scrollbarSize===undefined){ this.scrollbarSize=window.innerWidth - document.documentElement.clientWidth; } return this.scrollbarSize; }, isTablet: function(){ if(window.innerWidth < 992) return true; return false; }, isMobile: function(){ if(window.innerWidth <=480) return true; return false; }, isIOS: function (){ return [ 'iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod' ].includes(navigator.platform) || (navigator.userAgent.includes("Mac")&&"ontouchend" in document); }, refreshVCContent: function($elements){ if($elements||$(document.body).hasClass('elementor-page')){ $(window).trigger('resize'); } theme.refreshStickySidebar(true); if(typeof window.vc_js=='function') window.vc_js(); $(document.body).trigger('porto_refresh_vc_content', [$elements]); }, adminBarHeight: function(){ if(theme.adminBarHeightNum||0===theme.adminBarHeightNum){ return theme.adminBarHeightNum; } var obj=document.getElementById('wpadminbar'), fixed_top=$('.porto-scroll-progress.fixed-top'); if(fixed_top.length){ theme.adminBarHeightNum=fixed_top.height(); }else{ theme.adminBarHeightNum=0; } if(obj&&obj.offsetHeight&&window.innerWidth > 600){ theme.adminBarHeightNum +=obj.offsetHeight; } return theme.adminBarHeightNum; }, refreshStickySidebar: function(timeout, $sticky_sidebar){ if(typeof $sticky_sidebar=='undefined'){ $sticky_sidebar=$('.sidebar [data-plugin-sticky]'); } if($sticky_sidebar.get(0)){ if(timeout){ theme.requestTimeout(function(){ $sticky_sidebar.trigger('recalc.pin'); }, 400); }else{ $sticky_sidebar.trigger('recalc.pin'); }} }, scrolltoContainer: function($container, timeout){ if($container.get(0)){ if(window.innerWidth < 992){ $('.sidebar-overlay').trigger('click'); } if(!timeout){ timeout=600; } $('html, body').stop().animate({ scrollTop: $container.offset().top - theme.StickyHeader.sticky_height - theme.adminBarHeight() - theme.sticky_nav_height - 18 }, timeout, 'easeOutQuad'); }}, requestFrame: function(fn){ var handler=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame; if(!handler){ return setTimeout(fn, 1000 / 60); } var rt=new Object() rt.val=handler(fn); return rt; }, requestTimeout: function(fn, delay){ var handler=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame; if(!handler){ return setTimeout(fn, delay); } var start, rt=new Object(); function loop(timestamp){ if(!start){ start=timestamp; } var progress=timestamp - start; progress >=delay ? fn.call():rt.val=handler(loop); }; rt.val=handler(loop); return rt; }, deleteTimeout: function(timeoutID){ if(!timeoutID){ return; } var handler=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame; if(!handler){ return clearTimeout(timeoutID); } if(timeoutID.val){ return handler(timeoutID.val); }}, execPluginFunction: function(functionName, context){ var args=Array.prototype.slice.call(arguments, 2); var namespaces=functionName.split("."); var func=namespaces.pop(); for(var i=0; i < namespaces.length; i++){ context=context[namespaces[i]]; } return context[func].apply(context, args); }, getOptions: function(opts){ if(typeof(opts)=='object'){ return opts; }else if(typeof(opts)=='string'){ try { return JSON.parse(opts.replace(/'/g, '"').replace(';', '')); } catch(e){ return {};}}else{ return {};}}, mergeOptions: function(obj1, obj2){ var obj3={}; for(var attrname in obj1){ obj3[attrname]=obj1[attrname]; } for(var attrname in obj2){ obj3[attrname]=obj2[attrname]; } return obj3; }, intObs: function(selector, functionName, accY){ var $el; if(typeof selector=='string'){ $el=document.querySelectorAll(selector); }else{ $el=selector; } var intersectionObserverOptions={ rootMargin: '200px' } if(typeof accY!='undefined'){ intersectionObserverOptions.rootMargin='0px 0px ' + Number(accY) + 'px 0px'; } var observer=new IntersectionObserver(function(entries){ for(var i=0; i < entries.length; i++){ var entry=entries[i]; if(entry.intersectionRatio > 0){ var $this=$(entry.target), opts; if(typeof functionName=='string'){ var pluginOptions=theme.getOptions($this.data('plugin-options')); if(pluginOptions) opts=pluginOptions; theme.execPluginFunction(functionName, $this, opts); }else{ var callback=functionName; callback.call($this); } observer.unobserve(entry.target); }} }, intersectionObserverOptions); Array.prototype.forEach.call($el, function(obj){ observer.observe(obj); }); }, dynIntObsInit: function(selector, functionName, pluginDefaults){ var $el; if(typeof selector=='string'){ $el=document.querySelectorAll(selector); }else{ $el=selector; } Array.prototype.forEach.call($el, function(obj){ var $this=$(obj), opts; if($this.data('observer-init')){ return; } var pluginOptions=theme.getOptions($this.data('plugin-options')); if(pluginOptions) opts=pluginOptions; var mergedPluginDefaults=theme.mergeOptions(pluginDefaults, opts) var intersectionObserverOptions={ rootMargin: '0px 0px 200px 0px', thresholds: 0 } if(mergedPluginDefaults.accY){ intersectionObserverOptions.rootMargin='0px 0px ' + Number(mergedPluginDefaults.accY) + 'px 0px'; } var observer=new IntersectionObserver(function(entries){ for(var i=0; i < entries.length; i++){ var entry=entries[i]; if(entry.intersectionRatio > 0){ theme.execPluginFunction(functionName, $this, mergedPluginDefaults); observer.unobserve(entry.target); }} }, intersectionObserverOptions); observer.observe(obj); $this.data('observer-init', true); }); }}); if(theme.isIOS()){ document.body.classList.add('ios'); }}).apply(this, [window.theme, jQuery]); !function(){ "use strict"; if("object"==typeof window) if("IntersectionObserver" in window&&"IntersectionObserverEntry" in window&&"intersectionRatio" in window.IntersectionObserverEntry.prototype) "isIntersecting" in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype, "isIntersecting", { get: function(){ return this.intersectionRatio > 0 }}); else { var t=function(t){ for(var e=window.document, o=i(e); o;)o=i(e=o.ownerDocument); return e }(), e=[], o=null, n=null; s.prototype.THROTTLE_TIMEOUT=100, s.prototype.POLL_INTERVAL=null, s.prototype.USE_MUTATION_OBSERVER = !0, s._setupCrossOriginUpdater=function(){ return o||(o=function(t, o){ n=t&&o ? l(t, o):{ top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 }, e.forEach(function(t){ t._checkForIntersections() }) }), o }, s._resetCrossOriginUpdater=function(){ o=null, n=null }, s.prototype.observe=function(t){ if(!this._observationTargets.some(function(e){ return e.element==t })){ if(!t||1!=t.nodeType) throw new Error("target must be an Element"); this._registerInstance(), this._observationTargets.push({ element: t, entry: null }), this._monitorIntersections(t.ownerDocument), this._checkForIntersections() }}, s.prototype.unobserve=function(t){ this._observationTargets=this._observationTargets.filter(function(e){ return e.element!=t }), this._unmonitorIntersections(t.ownerDocument), 0==this._observationTargets.length&&this._unregisterInstance() }, s.prototype.disconnect=function(){ this._observationTargets=[], this._unmonitorAllIntersections(), this._unregisterInstance() }, s.prototype.takeRecords=function(){ var t=this._queuedEntries.slice(); return this._queuedEntries=[], t }, s.prototype._initThresholds=function(t){ var e=t||[0]; return Array.isArray(e)||(e=[e]), e.sort().filter(function(t, e, o){ if("number"!=typeof t||isNaN(t)||t < 0||t > 1) throw new Error("threshold must be a number between 0 and 1 inclusively"); return t!==o[e - 1] }) }, s.prototype._parseRootMargin=function(t){ var e=(t||"0px").split(/\s+/).map(function(t){ var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t); if(!e) throw new Error("rootMargin must be specified in pixels or percent"); return { value: parseFloat(e[1]), unit: e[2] }}); return e[1]=e[1]||e[0], e[2]=e[2]||e[0], e[3]=e[3]||e[1], e }, s.prototype._monitorIntersections=function(e){ var o=e.defaultView; if(o&&-1==this._monitoringDocuments.indexOf(e)){ var n=this._checkForIntersections, r=null, s=null; this.POLL_INTERVAL ? r=o.setInterval(n, this.POLL_INTERVAL):(h(o, "resize", n, !0), h(e, "scroll", n, !0), this.USE_MUTATION_OBSERVER&&"MutationObserver" in o&&(s=new o.MutationObserver(n)).observe(e, { attributes: !0, childList: !0, characterData: !0, subtree: !0 })), this._monitoringDocuments.push(e), this._monitoringUnsubscribes.push(function(){ var t=e.defaultView; t&&(r&&t.clearInterval(r), c(t, "resize", n, !0)), c(e, "scroll", n, !0), s&&s.disconnect() }); var u=this.root&&(this.root.ownerDocument||this.root)||t; if(e!=u){ var a=i(e); a&&this._monitorIntersections(a.ownerDocument) }} }, s.prototype._unmonitorIntersections=function(e){ var o=this._monitoringDocuments.indexOf(e); if(-1!=o){ var n=this.root&&(this.root.ownerDocument||this.root)||t; if(!this._observationTargets.some(function(t){ var o=t.element.ownerDocument; if(o==e) return !0; for(; o&&o!=n;){ var r=i(o); if(( o=r&&r.ownerDocument)==e) return !0 } return !1 })){ var r=this._monitoringUnsubscribes[o]; if(this._monitoringDocuments.splice(o, 1), this._monitoringUnsubscribes.splice(o, 1), r(), e!=n){ var s=i(e); s&&this._unmonitorIntersections(s.ownerDocument) }} }}, s.prototype._unmonitorAllIntersections=function(){ var t=this._monitoringUnsubscribes.slice(0); this._monitoringDocuments.length=0, this._monitoringUnsubscribes.length=0; for(var e=0; e < t.length; e++)t[e]() }, s.prototype._checkForIntersections=function(){ if(this.root||!o||n){ var t=this._rootIsInDom(), e=t ? this._getRootRect():{ top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 }; this._observationTargets.forEach(function(n){ var i=n.element, s=u(i), h=this._rootContainsTarget(i), c=n.entry, a=t&&h && this._computeTargetAndRootIntersection(i, s, e), l=null; this._rootContainsTarget(i) ? o&&!this.root||(l=e):l={ top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 }; var f=n.entry=new r({ time: window.performance&&performance.now&&performance.now(), target: i, boundingClientRect: s, rootBounds: l, intersectionRect: a }); c ? t&&h ? this._hasCrossedThreshold(c, f)&&this._queuedEntries.push(f):c&&c.isIntersecting&&this._queuedEntries.push(f):this._queuedEntries.push(f) }, this), this._queuedEntries.length&&this._callback(this.takeRecords(), this) }}, s.prototype._computeTargetAndRootIntersection=function(e, i, r){ if("none"!=window.getComputedStyle(e).display){ for(var s, h, c, a, f, d, g, m, v=i, _=p(e), b = !1; !b&&_;){ var w=null, y=1==_.nodeType ? window.getComputedStyle(_):{}; if("none"==y.display) return null; if(_==this.root||9==_.nodeType) if(b = !0, _==this.root||_==t) o&&!this.root ? !n||0==n.width&&0==n.height ?(_=null, w=null, v=null):w=n:w=r; else { var I=p(_), E=I&&u(I), T=I&&this._computeTargetAndRootIntersection(I, E, r); E&&T ?(_=I, w=l(E, T)):(_=null, v=null) }else{ var R=_.ownerDocument; _!=R.body&&_!=R.documentElement&&"visible"!=y.overflow&&(w=u(_)) } if(w&&(s=w, h=v, c=void 0, a=void 0, f=void 0, d=void 0, g=void 0, m=void 0, c=Math.max(s.top, h.top), a=Math.min(s.bottom, h.bottom), f=Math.max(s.left, h.left), d=Math.min(s.right, h.right), m=a - c, v=(g=d - f) >=0&&m >=0&&{ top: c, bottom: a, left: f, right: d, width: g, height: m }||null), !v) break; _=_&&p(_) } return v }}, s.prototype._getRootRect=function(){ var e; if(this.root&&!d(this.root)) e=u(this.root); else { var o=d(this.root) ? this.root:t, n=o.documentElement, i=o.body; e={ top: 0, left: 0, right: n.clientWidth||i.clientWidth, width: n.clientWidth||i.clientWidth, bottom: n.clientHeight||i.clientHeight, height: n.clientHeight||i.clientHeight }} return this._expandRectByRootMargin(e) }, s.prototype._expandRectByRootMargin=function(t){ var e=this._rootMarginValues.map(function(e, o){ return "px"==e.unit ? e.value:e.value *(o % 2 ? t.width:t.height) / 100 }), o={ top: t.top - e[0], right: t.right + e[1], bottom: t.bottom + e[2], left: t.left - e[3] }; return o.width=o.right - o.left, o.height=o.bottom - o.top, o }, s.prototype._hasCrossedThreshold=function(t, e){ var o=t&&t.isIntersecting ? t.intersectionRatio||0:-1, n=e.isIntersecting ? e.intersectionRatio||0:-1; if(o!==n) for(var i=0; i < this.thresholds.length; i++){ var r=this.thresholds[i]; if(r==o||r==n||r < o!=r < n) return !0 }}, s.prototype._rootIsInDom=function(){ return !this.root||f(t, this.root) }, s.prototype._rootContainsTarget=function(e){ var o=this.root&&(this.root.ownerDocument||this.root)||t; return f(o, e)&&(!this.root||o==e.ownerDocument) }, s.prototype._registerInstance=function(){ e.indexOf(this) < 0&&e.push(this) }, s.prototype._unregisterInstance=function(){ var t=e.indexOf(this); -1!=t&&e.splice(t, 1) }, window.IntersectionObserver=s, window.IntersectionObserverEntry=r } function i(t){ try { return t.defaultView&&t.defaultView.frameElement||null } catch(t){ return null }} function r(t){ this.time=t.time, this.target=t.target, this.rootBounds=a(t.rootBounds), this.boundingClientRect=a(t.boundingClientRect), this.intersectionRect=a(t.intersectionRect||{ top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 }), this.isIntersecting = !!t.intersectionRect; var e=this.boundingClientRect, o=e.width * e.height, n=this.intersectionRect, i=n.width * n.height; this.intersectionRatio=o ? Number(( i / o).toFixed(4)):this.isIntersecting ? 1:0 } function s(t, e){ var o, n, i, r=e||{}; if("function"!=typeof t) throw new Error("callback must be a function"); if(r.root&&1!=r.root.nodeType&&9!=r.root.nodeType) throw new Error("root must be a Document or Element"); this._checkForIntersections=(o=this._checkForIntersections.bind(this), n=this.THROTTLE_TIMEOUT, i=null, function(){ i||(i=setTimeout(function(){ o(), i=null }, n)) }), this._callback=t, this._observationTargets=[], this._queuedEntries=[], this._rootMarginValues=this._parseRootMargin(r.rootMargin), this.thresholds=this._initThresholds(r.threshold), this.root=r.root||null, this.rootMargin=this._rootMarginValues.map(function(t){ return t.value + t.unit }).join(" "), this._monitoringDocuments=[], this._monitoringUnsubscribes=[] } function h(t, e, o, n){ "function"==typeof t.addEventListener ? t.addEventListener(e, o, n||!1):"function"==typeof t.attachEvent&&t.attachEvent("on" + e, o) } function c(t, e, o, n){ "function"==typeof t.removeEventListener ? t.removeEventListener(e, o, n||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on" + e, o) } function u(t){ var e; try { e=t.getBoundingClientRect() } catch(t){ } return e ?(e.width&&e.height||(e={ top: e.top, right: e.right, bottom: e.bottom, left: e.left, width: e.right - e.left, height: e.bottom - e.top }), e):{ top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 }} function a(t){ return !t||"x" in t ? t:{ top: t.top, y: t.top, bottom: t.bottom, left: t.left, x: t.left, right: t.right, width: t.width, height: t.height }} function l(t, e){ var o=e.top - t.top, n=e.left - t.left; return { top: o, left: n, height: e.height, width: e.width, bottom: o + e.height, right: n + e.width }} function f(t, e){ for(var o=e; o;){ if(o==t) return !0; o=p(o) } return !1 } function p(e){ var o=e.parentNode; return 9==e.nodeType&&e!=t ? i(e):(o&&o.assignedSlot&&(o=o.assignedSlot.parentNode), o&&11==o.nodeType&&o.host ? o.host:o) } function d(t){ return t&&9===t.nodeType }}(); (function($){ 'use strict'; $.extend({ browserSelector: function(){ var hasTouch='ontouchstart' in window||navigator.msMaxTouchPoints; var u=navigator.userAgent, ua=u.toLowerCase(), is=function(t){ return ua.indexOf(t) > -1; }, g='gecko', w='webkit', s='safari', o='opera', h=document.documentElement, b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua)) ?('ie ie' + parseFloat(navigator.appVersion.split("MSIE")[1])):is('firefox/2') ? g + ' ff2':is('firefox/3.5') ? g + ' ff3 ff3_5':is('firefox/3') ? g + ' ff3':is('gecko/') ? g:is('opera') ? o +(/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery1:(/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery2:'')):is('konqueror') ? 'konqueror':is('chrome') ? w + ' chrome':is('iron') ? w + ' iron':is('applewebkit/') ? w + ' ' + s +(/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.jQuery1:''):is('mozilla/') ? g:'', is('j2me') ? 'mobile':is('iphone') ? 'iphone':is('ipod') ? 'ipod':is('mac') ? 'mac':is('darwin') ? 'mac':is('webtv') ? 'webtv':is('win') ? 'win':is('freebsd') ? 'freebsd':(is('x11')||is('linux')) ? 'linux':'', 'js']; var c=b.join(' '); if(theme.is_device_mobile){ c +=' mobile'; } if(hasTouch){ c +=' touch'; } h.className +=' ' + c; var isIE11 = !(window.ActiveXObject)&&"ActiveXObject" in window; if(isIE11){ $('html').removeClass('gecko').addClass('ie ie11'); return; }} }); $.browserSelector(); })(jQuery); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__accordion'; var Accordion=function($el, opts){ return this.initialize($el, opts); }; Accordion.defaults={ }; Accordion.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Accordion.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!$.fn.collapse){ return this; } var $el=this.options.wrapper, $collapse=$el.find('.collapse'), collapsible=$el.data('collapsible'), active_num=$el.data('active-tab'); if($collapse.length > 0){ if($el.data('use-accordion')&&'yes'==$el.data('use-accordion')){ $el.find('.collapse').attr('data-parent', '#' + $el.attr('id')); } if(collapsible=='yes'){ $collapse.collapse({ toggle: false, parent: '#' + $el.attr('id') }); }else if(!isNaN(active_num)&&active_num==parseInt(active_num)&&$el.find('.collapse').length > active_num){ $el.find('.collapse').collapse({ toggle: false, parent: '#' + $el.attr('id') }); $el.find('.collapse').eq(active_num - 1).collapse('toggle'); }else{ $el.find('.collapse').collapse({ parent: '#' + $el.attr('id') }); }} return this; }}; $.extend(theme, { Accordion: Accordion }); $.fn.themeAccordion=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Accordion($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__accordionMenu'; var AccordionMenu=function($el, opts){ return this.initialize($el, opts); }; AccordionMenu.defaults={ }; AccordionMenu.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, AccordionMenu.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.wrapper; $el.find('li.menu-item.active').each(function(){ var $this=$(this); if($this.find('> .arrow').get(0)) $this.find('> .arrow').trigger('click'); }); $el.on('click', '.arrow', function(e){ e.preventDefault(); e.stopPropagation(); var $this=$(this), $parent=$this.closest('li'); if(typeof self.options.open_one!='undefined'){ $parent.siblings('.open').children('.arrow').next().hide(); $parent.siblings('.open').removeClass('open'); $this.next().stop().toggle(); }else{ $this.next().stop().slideToggle(); } if($parent.hasClass('open')){ $parent.removeClass('open'); }else{ $parent.addClass('open'); } return false; }); return this; }}; $.extend(theme, { AccordionMenu: AccordionMenu }); $.fn.themeAccordionMenu=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.AccordionMenu($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { lazyload_menu: function($el, menu_type, menu_id){ if(!js_porto_vars.lazyload_menu&&'mobile_menu'!=menu_type){ return; } if(menu_type){ var reload_menu=false, menu_args={ action: 'porto_lazyload_menu', menu_type: menu_type, nonce: js_porto_vars.porto_nonce }; if(menu_id){ menu_args['menu_id']=menu_id; } var menu_loaded_fn=function(data){ if(!data){ return; } var $data=$(data); if('mobile_menu'!=menu_type){ $el.each(function(i){ var $menu=$(this), $main_menu=$data.children('.mega-menu, .sidebar-menu').eq(i); if(!$main_menu.length){ $main_menu=$data.find('.mega-menu, .sidebar-menu').eq(i); } $menu.children('li.menu-item-has-children').each(function(index){ var popup=$main_menu.children('li.menu-item-has-children').eq(index).children('.popup, .sub-menu'); if(popup.hasClass('popup')){ popup=popup.children('.inner'); } if(popup.length){ if($(this).children('.popup').length){ $(this).children('.popup').children('.inner').replaceWith(popup); }else if($menu.hasClass('overlay')){ $(this).children('.sub-menu').remove(); $(this).append(popup); }else{ $(this).children('.sub-menu').replaceWith(popup); }} }); if($menu.hasClass('mega-menu')){ theme.MegaMenu.build($menu); }else{ if($menu.hasClass('side-menu-accordion')){ $menu.themeAccordionMenu({ 'open_one': true }); }else{ theme.SidebarMenu.build($menu); }} $menu.addClass('sub-ready').trigger('sub-loaded'); }); } if($data.find('#nav-panel, #side-nav-panel').length||'mobile_menu'==menu_type){ var lazyload_again=false; if($('#nav-panel').length){ var $menu_content=$data.find('.mobile-nav-wrap > *'); if($menu_content.length){ $('#nav-panel .mobile-nav-wrap > *').replaceWith($menu_content); $('#nav-panel .mobile-nav-wrap').removeClass('skeleton-body porto-ajax-loading'); $('#nav-panel .accordion-menu').themeAccordionMenu(); }else{ lazyload_again=true; }}else if($('#side-nav-panel').length){ var $menu_content=$data.find('.side-nav-panel-close'); if($menu_content.length){ $('#side-nav-panel').replaceWith($menu_content.parent()); $('#side-nav-panel .accordion-menu').themeAccordionMenu(); }else{ lazyload_again=true; }} if(lazyload_again&&!reload_menu){ reload_menu=true; lazyload_again=false; var menu_again_args=menu_args; menu_again_args['porto_lazyload_menu_2']=1; $.post(window.location.href, menu_again_args, menu_loaded_fn); }} if(typeof $el=='object'&&$el.length){ $el.find('.porto-lazyload:not(.lazy-load-loaded)').themePluginLazyLoad({}); $el.find('.porto-carousel').each(function(){ $(this).themeCarousel($(this).data('plugin-options')); }); $el.find('[data-appear-animation]').each(function(){ $(this).themeAnimate($(this).data('plugin-options')); }); }}; $.post(window.location.href, menu_args, menu_loaded_fn); }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__chartCircular'; var ChartCircular=function($el, opts){ return this.initialize($el, opts); }; ChartCircular.defaults={ accX: 0, accY: -150, delay: 1, barColor: '#0088CC', trackColor: '#f2f2f2', scaleColor: false, scaleLength: 5, lineCap: 'round', lineWidth: 13, size: 175, rotate: 0, animate:({ duration: 2500, enabled: true }) }; ChartCircular.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, ChartCircular.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!$.fn.easyPieChart){ return this; } var self=this, $el=this.options.wrapper, value=this.options.percentValue ? parseInt(this.options.percentValue):parseInt($el.attr('data-percent'), 10), percentEl=$el.find('.percent'); if(!value) value=1; var labelValue=this.options.labelValue ? parseInt(this.options.labelValue, 10):value; $.extend(true, self.options, { onStep: function(from, to, currentValue){ percentEl.html(parseInt(labelValue * currentValue / value)); }}); $el.attr('data-percent', 0).easyPieChart(self.options); var handler; if(Number(self.options.delay) <=1000 / 60){ handler=theme.requestFrame; }else{ handler=theme.requestTimeout; } handler(function(){ if($el.data('easyPieChart')){ $el.data('easyPieChart').update(value); $el.attr('data-percent', value); }}, self.options.delay); return this; }}; $.extend(theme, { ChartCircular: ChartCircular }); $.fn.themeChartCircular=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.ChartCircular($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__fitVideo'; var FitVideo=function($el, opts){ return this.initialize($el, opts); }; FitVideo.defaults={ }; FitVideo.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, FitVideo.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!$.fn.fitVids){ return this; } var $el=this.options.wrapper; $el.fitVids(); $(window).on('resize', function(){ $el.fitVids(); }); return this; }}; $.extend(theme, { FitVideo: FitVideo }); $.fn.themeFitVideo=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.FitVideo($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__videobackground'; var PluginVideoBackground=function($el, opts){ return this.initialize($el, opts); }; PluginVideoBackground.defaults={ overlay: true, volume: 1, playbackRate: 1, muted: true, loop: true, autoplay: true, position: '50% 50%', posterType: 'detect' }; PluginVideoBackground.prototype={ initialize: function($el, opts){ this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginVideoBackground.defaults, opts, { path: this.$el.data('video-path'), wrapper: this.$el }); return this; }, build: function(){ if(!$.fn.vide||!this.options.path){ return this; } if(this.options.overlay){ this.options.wrapper.prepend($('
').addClass('video-overlay') ); } this.options.wrapper.vide(this.options.path, this.options); return this; }}; $.extend(theme, { PluginVideoBackground: PluginVideoBackground }); $.fn.themePluginVideoBackground=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginVideoBackground($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__flickrZoom'; var FlickrZoom=function($el, opts){ return this.initialize($el, opts); }; FlickrZoom.defaults={ }; FlickrZoom.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, FlickrZoom.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var $el=this.options.wrapper, links=[], i=0, $flickr_links=$el.find('.flickr_badge_image > a'); $flickr_links.each(function(){ var slide={}, $image=$(this).find('> img'); slide.src=$image.attr('src').replace('_s.', '_b.'); slide.title=$image.attr('title'); links[i]=slide; i++; }); $flickr_links.on('click', function(e){ e.preventDefault(); if($.fn.magnificPopup){ $.magnificPopup.close(); $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { items: links, gallery: { enabled: true }, type: 'image' }), $flickr_links.index($(this))); }}); return this; }}; $.extend(theme, { FlickrZoom: FlickrZoom }); $.fn.themeFlickrZoom=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.FlickrZoom($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__lazyload'; var PluginLazyLoad=function($el, opts){ return this.initialize($el, opts); }; PluginLazyLoad.defaults={ effect: 'show', appearEffect: '', appear: function(elements_left, settings){ }, load: function(elements_left, settings){ $(this).addClass('lazy-load-loaded'); }}; PluginLazyLoad.prototype={ initialize: function($el, opts){ if(!$el.length){ return this; } if(!$.fn.lazyload){ return this; } var options=$.extend(true, {}, PluginLazyLoad.defaults, opts, {}); return lazyload($el, options); }}; $.extend(theme, { PluginLazyLoad: PluginLazyLoad }); $.fn.themePluginLazyLoad=function(opts){ var $this=$(this); if($this.data(instanceName)){ return this; }else{ var ins=new PluginLazyLoad($.makeArray(this), opts); $this.data(instanceName, ins); } return this; }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var loadingOverlayTemplate=[ '
', '
', '
' ].join(''); var LoadingOverlay=function($wrapper, options){ return this.initialize($wrapper, options); }; LoadingOverlay.prototype={ options: { css: {}}, initialize: function($wrapper, options){ this.$wrapper=$wrapper; this .setVars() .setOptions(options) .build() .events(); this.$wrapper.data('loadingOverlay', this); }, setVars: function(){ this.$overlay=this.$wrapper.find('.loading-overlay'); return this; }, setOptions: function(options){ if(!this.$overlay.get(0)){ this.matchProperties(); } this.options=$.extend(true, {}, this.options, options); this.loaderClass=this.getLoaderClass(this.options.css.backgroundColor); return this; }, build: function(){ if(!this.$overlay.closest(document.documentElement).get(0)){ if(!this.$cachedOverlay){ this.$overlay=$(loadingOverlayTemplate).clone(); if(this.options.css){ this.$overlay.css(this.options.css); this.$overlay.find('.loader').addClass(this.loaderClass); }}else{ this.$overlay=this.$cachedOverlay.clone(); } this.$wrapper.append(this.$overlay); } if(!this.$cachedOverlay){ this.$cachedOverlay=this.$overlay.clone(); } return this; }, events: function(){ var _self=this; if(this.options.startShowing){ _self.show(); } if(this.$wrapper.is('body')||this.options.hideOnWindowLoad){ $(window).on('load error', function(){ _self.hide(); }); } if(this.options.listenOn){ $(this.options.listenOn) .on('loading-overlay:show beforeSend.ic', function(e){ e.stopPropagation(); _self.show(); }) .on('loading-overlay:hide complete.ic', function(e){ e.stopPropagation(); _self.hide(); }); } this.$wrapper .on('loading-overlay:show beforeSend.ic', function(e){ e.stopPropagation(); _self.show(); }) .on('loading-overlay:hide complete.ic', function(e){ e.stopPropagation(); _self.hide(); }); return this; }, show: function(){ this.build(); this.position=this.$wrapper.css('position').toLowerCase(); if(this.position!='relative'||this.position!='absolute'||this.position!='fixed'){ this.$wrapper.css({ position: 'relative' }); } this.$wrapper.addClass('loading-overlay-showing'); }, hide: function(){ var _self=this; this.$wrapper.removeClass('loading-overlay-showing'); setTimeout(function(){ if(this.position!='relative'||this.position!='absolute'||this.position!='fixed'){ _self.$wrapper.css({ position: '' }); }}, 500); }, matchProperties: function(){ var i, l, properties; properties=[ 'backgroundColor', 'borderRadius' ]; l=properties.length; for(i=0; i < l; i++){ var obj={}; obj[properties[i]]=this.$wrapper.css(properties[i]); $.extend(this.options.css, obj); }}, getLoaderClass: function(backgroundColor){ if(!backgroundColor||backgroundColor==='transparent'||backgroundColor==='inherit'){ return 'black'; } var hexColor, r, g, b, yiq; var colorToHex=function(color){ var hex, rgb; if(color.indexOf('#') > - 1){ hex=color.replace('#', ''); }else{ rgb=color.match(/\d+/g); hex=('0' + parseInt(rgb[0], 10).toString(16)).slice(-2) +('0' + parseInt(rgb[1], 10).toString(16)).slice(-2) +('0' + parseInt(rgb[2], 10).toString(16)).slice(-2); } if(hex.length===3){ hex=hex + hex; } return hex; }; hexColor=colorToHex(backgroundColor); r=parseInt(hexColor.substr(0, 2), 16); g=parseInt(hexColor.substr(2, 2), 16); b=parseInt(hexColor.substr(4, 2), 16); yiq=(( r * 299) +(g * 587) +(b * 114)) / 1000; return(yiq >=128) ? 'black':'white'; }}; $.extend(theme, { LoadingOverlay: LoadingOverlay }); $.fn.loadingOverlay=function(opts){ return this.each(function(){ var $this=$(this); var loadingOverlay=$this.data('loadingOverlay'); if(loadingOverlay){ return loadingOverlay; }else{ var options=opts||$this.data('loading-overlay-options')||{}; return new LoadingOverlay($this, options); }}); } $('body.loading-overlay-showing, [data-loading-overlay]').loadingOverlay(); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__masonry'; var Masonry=function($el, opts){ return this.initialize($el, opts); }; Masonry.defaults={ itemSelector: 'li', isOriginLeft: !theme.rtl }; Masonry.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Masonry.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!$.fn.isotope){ return this; } var self=this, $el=this.options.wrapper, trigger_timer=null; $el.isotope(this.options); $el.isotope('on', 'layoutComplete', function(){ if(typeof this.options.callback=='function'){ this.options.callback.call(); } if($el.find('.porto-lazyload:not(.lazy-load-loaded):visible').length){ $(window).trigger('scroll'); }}); $el.isotope('layout'); self.resize(); $(window).smartresize(function(){ self.resize() }); return this; }, resize: function(){ var self=this, $el=this.options.wrapper; if(self.resizeTimer){ theme.deleteTimeout(self.resizeTimer); } self.resizeTimer=theme.requestTimeout(function(){ if($el.data('isotope')){ $el.isotope('layout'); } delete self.resizeTimer; }, 600); }}; $.extend(theme, { Masonry: Masonry }); $.fn.themeMasonry=function(opts){ return this.map(function(){ var $this=$(this); imagesLoaded(this, function(){ if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Masonry($this, opts); }}); }); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__previewImage'; var PreviewImage=function($el, opts){ return this.initialize($el, opts); }; PreviewImage.defaults={ }; PreviewImage.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PreviewImage.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var $el=this.options.wrapper, image=$el.data('image'); if(image){ $el.css('background-image', 'url(' + image + ')'); } return this; }}; $.extend(theme, { PreviewImage: PreviewImage }); $.fn.themePreviewImage=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.PreviewImage($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__toggle'; var Toggle=function($el, opts){ return this.initialize($el, opts); }; Toggle.defaults={ }; Toggle.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Toggle.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var $el=this.options.wrapper; if($el.hasClass('active')) $el.find("> div.toggle-content").stop().slideDown(350, function(){ $(this).attr('style', '').show(); }); $el.on('click', "> label", function(e){ var parentSection=$(this).parent(), parentWrapper=$(this).closest("div.toogle"), parentToggles=$(this).closest(".porto-toggles"), isAccordion=parentWrapper.hasClass("toogle-accordion"), toggleContent=parentSection.find("> div.toggle-content"); if(isAccordion&&typeof(e.originalEvent)!="undefined"){ parentWrapper.find("section.toggle.active > label").trigger("click"); } if(!parentSection.hasClass("active")){ if(parentToggles.length){ if(parentToggles.data('view')=='one-toggle'){ parentToggles.find('.toggle').each(function(){ $(this).removeClass('active'); $(this).find("> div.toggle-content").stop().slideUp(350, function(){ $(this).attr('style', '').hide(); }); }); }} toggleContent.stop().slideDown(350, function(){ $(this).attr('style', '').show(); theme.refreshVCContent(toggleContent); }); parentSection.addClass("active"); }else{ if(!parentToggles.length||parentToggles.data('view')!='one-toggle'){ toggleContent.stop().slideUp(350, function(){ $(this).attr('style', '').hide(); }); parentSection.removeClass("active"); }} }); return this; }}; $.extend(theme, { Toggle: Toggle }); $.fn.themeToggle=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Toggle($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__parallax'; var Parallax=function($el, opts){ return this.initialize($el, opts); }; Parallax.defaults={ speed: 1.5, horizontalPosition: '50%', offset: 0, scale: false, startOffset: 7, scaleInvert: false, }; Parallax.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Parallax.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $window=$(window), offset, yPos, bgpos, background; background=$('
'); var bg=self.options.wrapper.data('image-src') ? 'url(' + self.options.wrapper.data('image-src') + ')':self.options.wrapper.css('background-image'); background.css({ 'background-image': bg, 'background-size': 'cover', 'background-position': '50% 0%', 'position': 'absolute', 'top': 0, 'left': 0, 'width': '100%', 'height': self.options.speed * 100 + '%' }); self.options.wrapper.prepend(background); self.options.wrapper.css({ 'position': 'relative', 'overflow': 'hidden' }); if(self.options.wrapper.attr('data-parallax-type')){ self.options.parallaxType='horizontal'; background.css({ 'background-position': '0% 50%', 'width': self.options.speed * 100 + '%', 'height': '100%', }); } if(self.options.scale){ background.wrap('
'); background.css({ 'transition': 'transform 500ms ease-out' }); this.scaleParallaxFunc=this.scaleParallax.bind(this); this.scaleParallaxFunc(); window.addEventListener('scroll', this.scaleParallaxFunc); window.addEventListener('resize', this.scaleParallaxFunc); } var parallaxEffectOnScrolResize=function(){ var skrollr_size=100 * self.options.speed, skrollr_start=-(skrollr_size - 100); if(!self.options.parallaxType){ background.attr("data-bottom-top", "top: " + skrollr_start + "%;").attr("data-top-bottom", "top: 0%;"); }else{ skrollr_start /=9.8; background.attr("data-bottom-top", "left: " + skrollr_start + "%;").attr("data-top-bottom", "left: 0%;"); }} if(!theme.is_device_mobile){ parallaxEffectOnScrolResize(); }else{ if(self.options.enableOnMobile==true){ parallaxEffectOnScrolResize(); }else{ self.options.wrapper.addClass('parallax-disabled'); }} return this; }, scaleParallax: function(){ var self=this, $window=$(window), scrollTop=$window.scrollTop(), $background=self.options.wrapper.find('.parallax-background'), elementOffset=self.options.wrapper.offset().top, currentElementOffset=(elementOffset - scrollTop), scrollPercent=Math.abs(+(currentElementOffset - $window.height()) /(self.options.startOffset ? self.options.startOffset:7)); scrollPercent=parseInt(( scrollPercent >=100) ? 100:scrollPercent); var currentScale=(scrollPercent / 100) * 50; if(!self.options.scaleInvert){ $background.css({ 'transform': 'scale(1.' + String(currentScale).padStart(2, '0') + ', 1.' + String(currentScale).padStart(2, '0') + ')' }); }else{ $background.css({ 'transform': 'scale(1.' + String(50 - currentScale).padStart(2, '0') + ', 1.' + String(50 - currentScale).padStart(2, '0') + ')' }); }}, disable: function(){ var self=this; if(self.options.scale){ window.removeEventListener('scroll', this.scaleParallaxFunc); window.removeEventListener('resize', this.scaleParallaxFunc); }} }; $.extend(theme, { Parallax: Parallax }); $.fn.themeParallax=function(opts){ if(typeof skrollr=='undefined'){ return this; } var obj=this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Parallax($this, opts); }}); if(theme.portoSkrollr){ theme.portoSkrollr.refresh(); }else if(!theme.is_device_mobile){ theme.portoSkrollr=skrollr.init({ forceHeight: false, smoothScrolling: false, mobileCheck: function(){ return theme.is_device_mobile }}); } return obj; }}).apply(this, [window.theme, jQuery]); !function(o, e){ "object"==typeof exports&&"undefined"!=typeof module ? e(exports):"function"==typeof define&&define.amd ? define(["exports"], e):e(o.observeElementInViewport={}) }(this, function(o){ function e(o, e, t, r){ if(void 0===t&&(t=function(){ }), void 0===r&&(r={}), !o) throw new Error("Target element to observe should be a valid DOM Node"); var n=Object.assign({}, { viewport: null, modTop: "0px", modRight: "0px", modBottom: "0px", modLeft: "0px", threshold: [0] }, r), i=n.viewport, f=n.modTop, s=n.modLeft, u=n.modBottom, a=n.modRight, d=n.threshold; if(!Array.isArray(d)&&"number"!=typeof d) throw new Error("threshold should be a number or an array of numbers"); var p=Array.isArray(d) ? d.map(function(o){ return Math.floor(o % 101) / 100 }):[Math.floor(d ? d % 101:0) / 100], c=Math.min.apply(Math, p), m={ root: i instanceof Node ? i:null, rootMargin: f + " " + a + " " + u + " " + s, threshold: p }, h=new IntersectionObserver(function(r, n){ var i=r.filter(function(e){ return e.target===o })[0], f=function(){ return n.unobserve(o) }; i&&(i.isInViewport=i.isIntersecting&&i.intersectionRatio >=c, i.isInViewport ? e(i, f, o):t(i, f, o)) }, m); return h.observe(o), function(){ return h.unobserve(o) }} o.observeElementInViewport=e, o.isInViewport=function(o, t){ return void 0===t&&(t={}), new Promise(function(r, n){ try { e(o, function(o, e){ e(), r(!0) }, function(o, e){ e(), r(!1) }, t) } catch(o){ n(o) }}) }}); (function(theme, $){ theme=theme||{}; var instanceName='__inviewportstyle'; var PluginInViewportStyle=function($el, opts){ return this.initialize($el, opts); }; PluginInViewportStyle.defaults={ viewport: window, scroll_bg_scale: false, scale_extra_class: '', set_round: '', scale_bg: '#08c', threshold: [0], modTop: '-200px', modBottom: '-200px', style: { 'transition': 'all 1s ease-in-out' }, styleIn: { 'background-color': '#08c' }, styleOut: { 'background-color': '#fff' }, }; PluginInViewportStyle.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginInViewportStyle.defaults, opts, {}); return this; }, build: function(){ var self=this, el=self.$el.get(0); if(self.options.scroll_bg_scale&&'undefined'!=typeof gsap){ self.$scaleObject=$('
').addClass(self.options.scale_extra_class); self.$el.addClass('view-scale-wrapper').append(self.$scaleObject); self.$scaleObject.css('background-color', self.options.scale_bg); self.scale=true; self.scaleEventFunc=self.scaleEvent.bind(this); self.scaleEventFunc(); $(window).on('scroll', self.scaleEventFunc); }else{ self.$el.css(self.options.style); if(typeof window.IntersectionObserver==='function'){ self.viewPort=observeElementInViewport.observeElementInViewport(el, function(){ self.$el.css(self.options.styleIn); }, function(){ self.$el.css(self.options.styleOut); }, { viewport: self.options.viewport, threshold: self.options.threshold, modTop: self.options.modTop, modBottom: self.options.modBottom } ) };} return this; }, scaleEvent: function(){ var self=this, position=self.$el[0].getBoundingClientRect(); if(self.scale&&position.top < window.innerHeight&&position.bottom >=0){ gsap.set(self.$scaleObject[0], { width: "150vmax", height: "150vmax", xPercent: -50, yPercent: -50, top: "50%", left: "50%" }); var scaleGsap=gsap.timeline({ scrollTrigger: { trigger: self.$el[0], start: "-50%", end: "0%", scrub: 2, invalidateOnRefresh: true, }, defaults: { ease: "none" }}); scaleGsap.fromTo(self.$scaleObject[0], { scale: 0 }, { x: 0, y: 0, ease: "power3.in", scale: 1 }); self.scale=false; }}, disable: function(){ var self=this; if(self.options.scroll_bg_scale){ self.$el.find('.scale-expand').remove(); self.$el.removeClass('view-scale-wrapper') }else{ self.$el.css({ 'background-color': '', 'transition': '' }); self.viewPort(); }} }; $.extend(theme, { PluginInViewportStyle: PluginInViewportStyle }); $.fn.themePluginInViewportStyle=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginInViewportStyle($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; $.fn.themePin=function(options){ var scrollY=0, lastScrollY=0, elements=[], disabled=false, $window=$(window), fixedSideTop=[], fixedSideBottom=[], prevDataTo=[]; options=options||{}; var recalculateLimits=function(){ for(var i=0, len=elements.length; i < len; i++){ var $this=elements[i]; if(options.minWidth&&window.innerWidth < options.minWidth){ if($this.parent().hasClass("pin-wrapper")){ $this.unwrap(); } $this.css({ width: "", left: "", top: "", position: "" }); if(options.activeClass){ $this.removeClass(options.activeClass); } $this.removeClass('sticky-transition'); $this.removeClass('sticky-absolute'); disabled=true; continue; }else{ disabled=false; } var $container=options.containerSelector ?($this.closest(options.containerSelector).length ? $this.closest(options.containerSelector):$(options.containerSelector)):$(document.body), offset=$this.offset(), containerOffset=$container.offset(); if(typeof containerOffset=='undefined'){ continue; } var parentOffset=$this.parent().offset(); if(!$this.parent().hasClass("pin-wrapper")){ $this.wrap("
"); if($this.hasClass('elementor-element-populated')){ var $el_cont=$this.closest('.elementor-container'); if($el_cont.length){ var matches=$el_cont.attr('class').match(/elementor-column-gap-([a-z]*)/g); if(matches&&matches.length){ var gap=matches[0].replace('elementor-column-gap-', ''); $this.addClass('porto-gap-' + gap); }} }} var pad=$.extend({ top: 0, bottom: 0 }, options.padding||{}); var $pin=$this.parent(), pt=parseInt($pin.parent().css('padding-top')), pb=parseInt($pin.parent().css('padding-bottom')); if(options.autoInit){ if($('#header').hasClass('header-side')){ pad.top=theme.adminBarHeight(); }else{ pad.top=theme.adminBarHeight(); if($('#header > .main-menu-wrap').length||!$('#header').hasClass('sticky-menu-header')){ pad.top +=theme.StickyHeader.sticky_height; }} if(typeof options.paddingOffsetTop!='undefined'){ pad.top +=parseInt(options.paddingOffsetTop, 10); }else{ pad.top +=18; } if(typeof options.paddingOffsetBottom!='undefined'){ pad.bottom=parseInt(options.paddingOffsetBottom, 10); }else{ pad.bottom=0; }} var bb=$this.css('border-bottom'), h=$this.outerHeight(); $this.css('border-bottom', '1px solid transparent'); var o_h=$this.outerHeight() - h - 1; $this.css('border-bottom', bb); $this.css({ width: $this.outerWidth() <=$pin.width() ? $this.outerWidth():$pin.width() }); $pin.css("height", $this.outerHeight() + o_h); if(( !options.autoFit&&!options.fitToBottom)||$this.outerHeight() <=$window.height()){ $this.data("themePin", { pad: pad, from:(options.containerSelector ? containerOffset.top:offset.top) - pad.top + pt, pb: pb, parentTop: parentOffset.top - pt, offset: o_h }); }else{ $this.data("themePin", { pad: pad, fromFitTop:(options.containerSelector ? containerOffset.top:offset.top) - pad.top + pt, from:(options.containerSelector ? containerOffset.top:offset.top) + $this.outerHeight() - window.innerHeight + pt, pb: pb, parentTop: parentOffset.top - pt, offset: o_h }); }} }; var onScroll=function(){ if(disabled){ return; } scrollY=$window.scrollTop(); var window_height=window.innerHeight||$window.height(); for(var i=0, len=elements.length; i < len; i++){ var $this=$(elements[i]), data=$this.data("themePin"), sidebarTop; let contentWrap=$this.closest('.porto-products-filter-body'); let sidebarWrap=$this.closest('.sidebar'); if(contentWrap.length&&sidebarWrap.length){ if($.contains(contentWrap[0], sidebarWrap[0])&&!contentWrap.hasClass('opened')){ continue; }} if(!data||typeof data.pad=='undefined'){ continue; } var $container=options.containerSelector ?($this.closest(options.containerSelector).length ? $this.closest(options.containerSelector):$(options.containerSelector)):$(document.body), isFitToTop=(!options.autoFit&&!options.fitToBottom)||($this.outerHeight() + data.pad.top) <=window_height; data.end=$container.offset().top + $container.height(); if(isFitToTop){ data.to=$container.offset().top + $container.height() - $this.outerHeight() - data.pad.bottom - data.pb; }else{ data.to=$container.offset().top + $container.height() - window_height - data.pb; data.to2=$container.height() - $this.outerHeight() - data.pad.bottom - data.pb; } if(prevDataTo[i]===0){ prevDataTo[i]=data.to; } if(isFitToTop){ var from=data.from - data.pad.bottom, to=data.to - data.pad.top - data.offset, $parent=$this.closest('.sticky-nav-wrapper'), widgetTop; if($parent.length){ widgetTop=$parent.offset().top - data.pad.top; if(widgetTop > from){ from=widgetTop; }} if(typeof data.fromFitTop!='undefined'&&data.fromFitTop){ from=data.fromFitTop - data.pad.bottom; } if(from + $this.outerHeight() > data.end||from >=to){ $this.css({ position: "", top: "", left: "" }); if(options.activeClass){ $this.removeClass(options.activeClass); } $this.removeClass('sticky-transition'); $this.removeClass('sticky-absolute'); continue; } if(scrollY > from&&scrollY < to){ !($this.css("position")=="fixed")&&$this.css({ left: $this.offset().left, top: data.pad.top }).css("position", "fixed"); if(options.activeClass){ $this.addClass(options.activeClass); } $this.removeClass('sticky-transition'); $this.removeClass('sticky-absolute'); }else if(scrollY >=to){ $this.css({ left: "", top: to - data.parentTop + data.pad.top }).css("position", "absolute"); if(options.activeClass){ $this.addClass(options.activeClass); } if($this.hasClass('sticky-absolute')) $this.addClass('sticky-transition'); $this.addClass('sticky-absolute'); }else{ $this.css({ position: "", top: "", left: "" }); if(options.activeClass){ $this.removeClass(options.activeClass); } $this.removeClass('sticky-transition'); $this.removeClass('sticky-absolute'); }}else if(options.fitToBottom){ var from=data.from, to=data.to; if(data.from + window_height > data.end||data.from >=to){ $this.css({ position: "", top: "", bottom: "", left: "" }); if(options.activeClass){ $this.removeClass(options.activeClass); } $this.removeClass('sticky-transition'); $this.removeClass('sticky-absolute'); continue; } if(scrollY > from&&scrollY < to){ !($this.css("position")=="fixed")&&$this.css({ left: $this.offset().left, bottom: data.pad.bottom, top: "" }).css("position", "fixed"); if(options.activeClass){ $this.addClass(options.activeClass); } $this.removeClass('sticky-transition'); $this.removeClass('sticky-absolute'); }else if(scrollY >=to){ $this.css({ left: "", top: data.to2, bottom: "" }).css("position", "absolute"); if(options.activeClass){ $this.addClass(options.activeClass); } if($this.hasClass('sticky-absolute')) $this.addClass('sticky-transition'); $this.addClass('sticky-absolute'); }else{ $this.css({ position: "", top: "", bottom: "", left: "" }); if(options.activeClass){ $this.removeClass(options.activeClass); } $this.removeClass('sticky-transition'); $this.removeClass('sticky-absolute'); }}else{ var this_height=$this.outerHeight() if(prevDataTo[i]!=data.to){ if(fixedSideBottom[i]&&this_height + $this.offset().top + data.pad.bottom < scrollY + window_height){ fixedSideBottom[i]=false; }} if(( this_height + data.pad.top + data.pad.bottom) > window_height||fixedSideTop[i]||fixedSideBottom[i]){ var padTop=parseInt($this.parent().parent().css('padding-top')); if(scrollY + data.pad.top - padTop <=data.parentTop){ $this.css({ position: "", top: "", bottom: "", left: "" }); fixedSideTop[i]=fixedSideBottom[i]=false; if(options.activeClass){ $this.removeClass(options.activeClass); }}else if(scrollY >=data.to){ $this.css({ left: "", top: data.to2, bottom: "" }).css("position", "absolute"); if(options.activeClass){ $this.addClass(options.activeClass); }}else{ if(scrollY >=lastScrollY){ if(fixedSideTop[i]){ fixedSideTop[i]=false; sidebarTop=$this.offset().top - data.parentTop; $this.css({ left: "", top: sidebarTop, bottom: "" }).css("position", "absolute"); if(options.activeClass){ $this.addClass(options.activeClass); }}else if(!fixedSideBottom[i]&&this_height + $this.offset().top + data.pad.bottom < scrollY + window_height){ fixedSideBottom[i]=true; !($this.css("position")=="fixed")&&$this.css({ left: $this.offset().left, bottom: data.pad.bottom, top: "" }).css("position", "fixed"); if(options.activeClass){ $this.addClass(options.activeClass); }} }else if(scrollY < lastScrollY){ if(fixedSideBottom[i]){ fixedSideBottom[i]=false; sidebarTop=$this.offset().top - data.parentTop; $this.css({ left: "", top: sidebarTop, bottom: "" }).css("position", "absolute"); if(options.activeClass){ $this.addClass(options.activeClass); }}else if(!fixedSideTop[i]&&$this.offset().top >=scrollY + data.pad.top){ fixedSideTop[i]=true; !($this.css("position")=="fixed")&&$this.css({ left: $this.offset().left, top: data.pad.top, bottom: '' }).css("position", "fixed"); if(options.activeClass){ $this.addClass(options.activeClass); }}else if(!fixedSideBottom[i]&&fixedSideTop[i]&&$this.css('position')=='absolute'&&$this.offset().top >=scrollY + data.pad.top){ fixedSideTop[i]=false; }} }}else{ if(scrollY >=(data.parentTop - data.pad.top)){ $this.css({ position: 'fixed', top: data.pad.top }); }else{ $this.css({ position: "", top: "", bottom: "", left: "" }); if(options.activeClass){ $this.removeClass(options.activeClass); }} fixedSideTop[i]=fixedSideBottom[i]=false; }} prevDataTo[i]=data.to; } lastScrollY=scrollY; }; var update=function(){ recalculateLimits(); onScroll(); }, r_timer=null; this.each(function(){ var $this=$(this), data=$this.data('themePin')||{}; if(data&&data.update){ return; } elements.push($this); $("img", this).one("load", function(){ if(r_timer){ theme.deleteTimeout(r_timer); } r_timer=theme.requestFrame(recalculateLimits); }); data.update=update; $this.data('themePin', data); fixedSideTop.push(false); fixedSideBottom.push(false); prevDataTo.push(0); }); window.addEventListener('touchmove', onScroll, { passive: true }); window.addEventListener('scroll', onScroll, { passive: true }); recalculateLimits(); if(!theme.isLoaded){ $window.on('load', update); }else{ update(); } $(this).on('recalc.pin', function(){ recalculateLimits(); onScroll(); }); return this; }; theme=theme||{}; var instanceName='__sticky'; var Sticky=function($el, opts){ return this.initialize($el, opts); }; Sticky.defaults={ autoInit: false, minWidth: 767, activeClass: 'sticky-active', padding: { top: 0, bottom: 0 }, offsetTop: 0, offsetBottom: 0, autoFit: false, fitToBottom: false }; Sticky.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Sticky.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!$.fn.themePin){ return this; } var self=this, $el=this.options.wrapper, stickyResizeTrigger; if($el.hasClass('porto-sticky-nav')){ this.options.padding.top=theme.StickyHeader.sticky_height + theme.adminBarHeight(); this.options.activeClass='sticky-active'; this.options.containerSelector='.main-content-wrap'; theme.sticky_nav_height=$el.outerHeight(); if(this.options.minWidth > window.innerWidth) theme.sticky_nav_height=0; } $el.themePin(this.options); $(window).smartresize(function(){ if(stickyResizeTrigger){ clearTimeout(stickyResizeTrigger); } stickyResizeTrigger=setTimeout(function(){ $el.trigger('recalc.pin'); }, 800); var $parent=$el.parent(); $el.outerWidth($parent.width()); if($el.css('position')=='fixed'){ $el.css('left', $parent.offset().left); } if($el.hasClass('porto-sticky-nav')){ theme.sticky_nav_height=$el.outerHeight(); if(self.options.minWidth > window.innerWidth) theme.sticky_nav_height=0; }}); return this; }}; $.extend(theme, { Sticky: Sticky }); $.fn.themeSticky=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ $this.trigger('recalc.pin'); setTimeout(function(){ $this.trigger('recalc.pin'); }, 800); return $this.data(instanceName); }else{ return new theme.Sticky($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; $(function(){ $(document.body).on('click', '.mobile-toggle', function(e){ var $nav_panel=$('#nav-panel'); if($nav_panel.length > 0){ if($(this).closest('.header-main').length&&$nav_panel.closest('.header-builder-p').length&&!$nav_panel.parent('.header-main').length){ $nav_panel.appendTo($(this).closest('.header-main')); }else if($(this).closest('.header-main').length&&$nav_panel.closest('.wp-block-template-part').length){ $nav_panel.insertAfter($(this).closest('.header-main')); } if($nav_panel.is(':visible')&&$('#header').hasClass('sticky-header')){ var h_h=$('#header').height(), p_h=$nav_panel.outerHeight(); if(h_h > p_h + 30){ $('#header').css('height', h_h - p_h); }} $nav_panel.stop().slideToggle(); }else if($('#side-nav-panel').length > 0){ $('html').toggleClass('panel-opened'); $('.panel-overlay').toggleClass('active'); } if($('#nav-panel .skeleton-body, #side-nav-panel .skeleton-body').length){ theme.lazyload_menu(1, 'mobile_menu'); } e.preventDefault(); }); $(document.body).on('click', '.panel-overlay', function(){ $('html').css('transition', 'margin .3s').removeClass('panel-opened'); theme.requestTimeout(function(){ $('html').css('transition', ''); }, 260); $(this).removeClass('active'); }); $(document.body).on('click', '#side-nav-panel .side-nav-panel-close', function(e){ e.preventDefault(); $('.panel-overlay').trigger('click'); }); $(window).on('resize', function(){ if(window.innerWidth > 991){ $('#nav-panel').hide(); if($('html').hasClass('panel-opened')){ $('.panel-overlay').trigger('click'); }} }); }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; $(function(){ $(document).on('click', '.blog-like, .portfolio-like', function(e){ e.preventDefault(); var $this=$(this), parentObj=this.parentNode, item_id=$this.attr('data-id'), is_blog=$this.hasClass('blog-like'), sendData={ nonce: js_porto_vars.porto_nonce }; if(is_blog){ if($this.hasClass('updating')){ return false; } $this.addClass('updating').text('...'); sendData.blog_id=item_id; sendData.action='porto_blog-like'; }else{ sendData.portfolio_id=item_id; sendData.action='porto_portfolio-like'; } $.post(theme.ajax_url, sendData, function(data){ if(data){ $this.remove(); parentObj.innerHTML=data; if(typeof bootstrap!='undefined'){ var tooltipTriggerList=[].slice.call(parentObj.querySelectorAll('[data-bs-tooltip]')); tooltipTriggerList.map(function(tooltipTriggerEl){ return new bootstrap.Tooltip(tooltipTriggerEl) }); }} } ); return false; }); }); }).apply(this, [window.theme, jQuery]); var scrolltotop={ setting: { startline: 100, scrollto: 0, scrollduration: 1000, fadeduration: [500, 100] }, controlHTML: '', controlattrs: { offsetx: 10, offsety: 10 }, anchorkeyword: '#top', state: { isvisible: false, shouldvisible: false }, scrollup: function(){ if(!this.cssfixedsupport) this.$control.css({ opacity: 0 }); var dest=isNaN(this.setting.scrollto) ? this.setting.scrollto:parseInt(this.setting.scrollto); if(typeof dest=="string"&&jQuery('#' + dest).length==1) dest=jQuery('#' + dest).offset().top; else dest=0; this.$body.stop().animate({ scrollTop: dest }, this.setting.scrollduration); }, keepfixed: function(){ var $window=jQuery(window); var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx; var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety; this.$control.css({ left: controlx + 'px', top: controly + 'px' }); }, togglecontrol: function(){ var scrolltop=jQuery(window).scrollTop(); if(!this.cssfixedsupport) this.keepfixed(); this.state.shouldvisible=(scrolltop >=this.setting.startline) ? true:false; if(this.state.shouldvisible&&!this.state.isvisible){ this.$control.stop().animate({ opacity: 1 }, this.setting.fadeduration[0]); this.state.isvisible=true; } else if(this.state.shouldvisible==false&&this.state.isvisible){ this.$control.stop().animate({ opacity: 0 }, this.setting.fadeduration[1]); this.state.isvisible=false; }}, init: function(){ jQuery(document).ready(function($){ var mainobj=scrolltotop; var iebrws=document.all; mainobj.cssfixedsupport = !iebrws||iebrws&&document.compatMode=="CSS1Compat"&&window.XMLHttpRequest mainobj.$body=(window.opera) ?(document.compatMode=="CSS1Compat" ? $('html'):$('body')):$('html,body'); mainobj.$control=$('
' + mainobj.controlHTML + '
') .css({ position: mainobj.cssfixedsupport ? 'fixed':'absolute', bottom: mainobj.controlattrs.offsety, opacity: 0, cursor: 'pointer' }) .attr({ title: '' }) .on('click', function(){ mainobj.scrollup(); return false; }) .appendTo('body'); if(document.all&&!window.XMLHttpRequest&&mainobj.$control.text()!='') mainobj.$control.css({ width: mainobj.$control.width() }); mainobj.togglecontrol(); $('a[href="' + mainobj.anchorkeyword + '"]').on('click', function(){ mainobj.scrollup(); return false; }); $(window).on('scroll resize', function(e){ mainobj.togglecontrol(); }); }); }}; (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { ScrollToTop: { defaults: { html: '', offsetx: 10, offsety: 0 }, initialize: function(html, offsetx, offsety){ if($('#topcontrol').length){ return this; } this.html=(html||this.defaults.html); this.offsetx=(offsetx||this.defaults.offsetx); this.offsety=(offsety||this.defaults.offsety); this.build(); return this; }, build: function(){ var self=this; if(typeof scrolltotop!=='undefined'){ scrolltotop.controlHTML=self.html; scrolltotop.controlattrs={ offsetx: self.offsetx, offsety: self.offsety }; scrolltotop.init(); } return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { MegaMenu: { defaults: { menu: $('.mega-menu') }, initialize: function($menu){ this.$menu=($menu||this.defaults.menu); this.build() .events(); return this; }, popupWidth: function(){ var winWidth=window.innerWidth, popupWidth=theme.bodyWidth - theme.grid_gutter_width * 2; if(!$('body').hasClass('wide')){ if(winWidth >=theme.container_width + theme.grid_gutter_width - 1) popupWidth=theme.container_width - theme.grid_gutter_width; else if(winWidth >=992) popupWidth=960 - theme.grid_gutter_width; else if(winWidth >=768) popupWidth=720 - theme.grid_gutter_width; } return popupWidth; }, calcMenuPosition: function(menu_obj){ var menu=menu_obj, $header_container=$('#header .header-main').hasClass('elementor-section') ? $('#header .header-main > .elementor-container'):($("#header .header-main .container-fluid").length ? $("#header .header-main .container-fluid"):($("#header .header-main .container").length ? $("#header .header-main .container"):null)); if(null===$header_container||!$header_container.length){ return; } var menuContainerWidth=$header_container.outerWidth() - parseInt($header_container.css('padding-left')) - parseInt($header_container.css('padding-right')); if(menuContainerWidth < 900) return; if(menu.parent().hasClass('pos-fullwidth')){ menu.get(0).style.width=menuContainerWidth + 'px'; } var browserWidth=theme.bodyWidth, menuLeftPos=menu.offset().left -(browserWidth - menuContainerWidth) / 2; if(window.theme.rtl){ menuLeftPos=theme.bodyWidth -(menu.offset().left + menu.outerWidth()) -(browserWidth - menuContainerWidth) / 2; } var menuWidth=menu.width(), remainWidth=menuContainerWidth -(menuLeftPos + menuWidth), l=false; if(menuLeftPos > remainWidth&&menuLeftPos < menuWidth){ l=(menuLeftPos + remainWidth) / 3; } if(remainWidth < 0){ l=-remainWidth; } return l; }, build: function($menu){ var self=this; if(!$menu){ $menu=self.$menu; } $menu.each(function(){ var $menu=$(this), $menu_container=$menu.closest('.container'), container_width=self.popupWidth(); if($menu.closest('.porto-popup-menu').length){ return false; } var $menu_items=$menu.children('li.has-sub'); $menu_items.each(function(){ var $menu_item=$(this), $popup=$menu_item.children('.popup'); if($popup.length){ var popup_obj=$popup.get(0); popup_obj.style.display='block'; if($menu_item.hasClass('wide')){ popup_obj.style.left=0; var padding=parseInt($popup.css('padding-left')) + parseInt($popup.css('padding-right')) + parseInt($popup.find('> .inner').css('padding-left')) + parseInt($popup.find('> .inner').css('padding-right')); var row_number=4; if($menu_item.hasClass('col-2')) row_number=2; if($menu_item.hasClass('col-3')) row_number=3; if($menu_item.hasClass('col-4')) row_number=4; if($menu_item.hasClass('col-5')) row_number=5; if($menu_item.hasClass('col-6')) row_number=6; if(window.innerWidth < 992) row_number=1; var col_length=0; $popup.find('> .inner > ul > li').each(function(){ var cols=parseFloat($(this).attr('data-cols')); if(cols <=0||!cols) cols=1; if(cols > row_number) cols=row_number; col_length +=cols; }); if(col_length > row_number) col_length=row_number; var popup_max_width=$popup.data('popup-mw') ? $popup.data('popup-mw'):$popup.find('.inner').css('max-width'), col_width=container_width / row_number; if('none'!==popup_max_width&&popup_max_width < container_width){ col_width=parseInt(popup_max_width) / row_number; } $popup.find('> .inner > ul > li').each(function(){ var cols=parseFloat($(this).data('cols')); if(cols <=0) cols=1; if(cols > row_number) cols=row_number; if($menu_item.hasClass('pos-center')||$menu_item.hasClass('pos-left')||$menu_item.hasClass('pos-right')) this.style.width=(100 / col_length * cols) + '%'; else this.style.width=(100 / row_number * cols) + '%'; }); if($menu_item.hasClass('pos-center')){ $popup.find('> .inner > ul').get(0).style.width=(col_width * col_length - padding) + 'px'; var left_position=$popup.offset().left -(theme.bodyWidth - col_width * col_length) / 2; popup_obj.style.left='-' + left_position + 'px'; }else if($menu_item.hasClass('pos-left')){ $popup.find('> .inner > ul').get(0).style.width=(col_width * col_length - padding) + 'px'; popup_obj.style.left='-15px'; }else if($menu_item.hasClass('pos-right')){ $popup.find('> .inner > ul').get(0).style.width=(col_width * col_length - padding) + 'px'; popup_obj.style.right='-15px'; popup_obj.style.left='auto'; }else{ if(!$menu_item.hasClass('pos-fullwidth')){ $popup.find('> .inner > ul').get(0).style.width=(container_width - padding) + 'px'; } if(theme.rtl){ popup_obj.style.right=0; popup_obj.style.left='auto'; } setTimeout(()=> { var left_position=self.calcMenuPosition($popup); if(theme.rtl){ popup_obj.style.right='-15px'; popup_obj.style.left='auto'; if(left_position){ popup_obj.style.right='-' + left_position + 'px'; }}else{ popup_obj.style.left='-15px'; popup_obj.style.right='auto'; if(left_position){ popup_obj.style.left='-' + left_position + 'px'; }} }); }}else{ if($menu_item.hasClass('pos-center')){ }else if($menu_item.hasClass('pos-left')){ }else if($menu_item.hasClass('pos-right')){ }else{ if($popup.offset().left + $popup.width() > window.innerWidth){ $menu_item.addClass('pos-right'); }else if($popup.find('> .inner > ul').length){ var $sub_menu=$popup.find('> .inner > ul').eq(0); if($sub_menu.offset().left + $sub_menu.width() + 200 > window.innerWidth){ $sub_menu.addClass('pos-left'); }} }} $menu_item.addClass('sub-ready'); }}); }); return self; }, events: function(){ var self=this; $(window).smartresize(function(){ self.build(); }); if(theme.isLoaded){ theme.requestFrame(function(){ self.build(); }); }else{ $(window).on('load', function(){ theme.requestFrame(function(){ self.build(); }); }); } return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { SidebarMenu: { defaults: { menu: $('.sidebar-menu:not(.side-menu-accordion)'), toggle: $('.widget_sidebar_menu .widget-title .toggle'), menu_toggle: $('#main-toggle-menu .menu-title') }, rtl: theme.rtl, initialize: function($menu, $toggle, $menu_toggle){ if(this.$menu&&this.$menu.length&&$menu&&$menu.length){ this.$menu=$.uniqueSort($.merge(this.$menu, $menu)); this.build(); return this; } this.$menu=($menu||this.defaults.menu); if(!this.$menu.length){ return this; } this.$toggle=($toggle||this.defaults.toggle); this.$menu_toggle=($menu_toggle||this.defaults.menu_toggle); this.build() .events(); return this; }, isRightSidebar: function($menu){ var flag=false; if(this.rtl){ flag = !($('#main').hasClass('column2-right-sidebar')||$('#main').hasClass('column2-wide-right-sidebar')); }else{ flag=$('#main').hasClass('column2-right-sidebar')||$('#main').hasClass('column2-wide-right-sidebar'); } if($menu.closest('#main-toggle-menu').length){ if(this.rtl){ flag=true; }else{ flag=false; }} var $header_wrapper=$menu.closest('.header-wrapper'); if($header_wrapper.length&&$header_wrapper.hasClass('header-side-nav')){ if(this.rtl){ flag=true; }else{ flag=false; } if($('.page-wrapper').hasClass('side-nav-right')){ if(this.rtl){ flag=false; }else{ flag=true; }} } return flag; }, popupWidth: function(){ var winWidth=window.innerWidth, popupWidth=theme.bodyWidth - theme.grid_gutter_width * 2; if(!$('body').hasClass('wide')){ if(winWidth >=theme.container_width + theme.grid_gutter_width - 1) popupWidth=theme.container_width - theme.grid_gutter_width; else if(winWidth >=992) popupWidth=960 - theme.grid_gutter_width; else if(winWidth >=768) popupWidth=720 - theme.grid_gutter_width; } return popupWidth; }, build: function($menus){ var self=this; if(!$menus){ $menus=self.$menu; } if(!$menus.length){ return; } var $parent_toggle_wrap=$menus.parent('.toggle-menu-wrap'), parent_toogle_wrap=null; if($parent_toggle_wrap.length&&$parent_toggle_wrap.is(':hidden')){ parent_toogle_wrap=$parent_toggle_wrap.get(0); parent_toogle_wrap.style.display='block'; parent_toogle_wrap.style.visibility='hidden'; } $menus.each(function(){ var menuobj=this, $menu=$(this), container_width; if(menuobj.classList.contains('side-menu-slide')){ return; } if(window.innerWidth < 992) container_width=self.popupWidth(); else { var menu_width=this.offsetWidth ? this.offsetWidth:$menu.width(); container_width=self.popupWidth() - menu_width - 45; } var is_right_sidebar=self.isRightSidebar($menu), $menu_items=$menu.children('li'); $menu_items.each(function(){ var $menu_item=$(this), $popup=$menu_item.children('.popup'); if($popup.length){ var popup_obj=$popup.get(0), is_opened=false; if($popup.is(':visible')){ is_opened=true; }else{ popup_obj.style.display='block'; } if($menu_item.hasClass('wide')){ if(!$menu.hasClass('side-menu-columns')){ popup_obj.style.left=0; } var row_number=4; if($menu_item.hasClass('col-2')) row_number=2; if($menu_item.hasClass('col-3')) row_number=3; if($menu_item.hasClass('col-4')) row_number=4; if($menu_item.hasClass('col-5')) row_number=5; if($menu_item.hasClass('col-6')) row_number=6; if(window.innerWidth < 992) row_number=1; var col_length=0; $popup.find('> .inner > ul > li').each(function(){ var cols=parseFloat($(this).data('cols')); if(!cols||cols <=0) cols=1; if(cols > row_number) cols=row_number; col_length +=cols; }); if(col_length > row_number) col_length=row_number; var popup_max_width=$popup.data('popup-mw') ? $popup.data('popup-mw'):$popup.find('.inner').css('max-width'), col_width=container_width / row_number; if('none'!==popup_max_width&&popup_max_width < container_width){ col_width=parseInt(popup_max_width) / row_number; } $popup.find('> .inner > ul > li').each(function(){ var cols=parseFloat($(this).data('cols')); if(cols <=0) cols=1; if(cols > row_number) cols=row_number; if($menu_item.hasClass('pos-center')||$menu_item.hasClass('pos-left')||$menu_item.hasClass('pos-right')) this.style.width=(100 / col_length * cols) + '%'; else this.style.width=(100 / row_number * cols) + '%'; }); popup_obj.children[0].children[0].style.width=col_width * col_length + 1 + 'px'; if(!$menu.hasClass('side-menu-columns')){ if(is_right_sidebar){ popup_obj.style.left='auto'; popup_obj.style.right=(this.offsetWidth ? this.offsetWidth:$(this).width()) + 'px'; }else{ popup_obj.style.left=(this.offsetWidth ? this.offsetWidth:$(this).width()) + 'px'; popup_obj.style.right='auto'; }} } if(!is_opened){ popup_obj.style.display='none'; } if(menuobj.classList.contains('side-menu-accordion')){ }else if(menuobj.classList.contains('side-menu-slide')){ }else if(!$menu_item.hasClass('sub-ready')){ if(!('ontouchstart' in document)&&window.innerWidth > 991){ $menu_item.on('mouseenter', function(){ $menu_items.find('.popup').hide(); $popup.show(); $popup.parent().addClass('open'); }).on('mouseleave', function(){ $popup.hide(); $popup.parent().removeClass('open'); }); }else{ $menu_item.on('click', '.arrow', function(){ $popup.slideToggle(); $popup.parent().toggleClass('open'); }); } $menu_item.addClass('sub-ready'); }} }); }); if($menus.hasClass('side-menu-slide')){ var slideNavigation={ $mainNav: $menus, $mainNavItem: $menus.find('li'), build: function(){ var self=this; self.menuNav(); }, initSub: function($obj){ var currentMenu=$obj.closest('ul'), nextMenu=$obj.parent().find('ul').first(); if(nextMenu.children('.menu-item').children('.go-back').length < 1){ nextMenu.prepend(''); } var nextMenuHeightDiff=nextMenu.find('> li').length * nextMenu.find('> li').outerHeight() - nextMenu.outerHeight(); currentMenu.addClass('next-menu'); nextMenu.addClass('visible'); currentMenu.css({ overflow: 'visible', 'overflow-y': 'visible' }); if(nextMenuHeightDiff > 0){ nextMenu.css({ overflow: 'hidden', 'overflow-y': 'scroll' }); } if(nextMenu.outerHeight() <(nextMenu.closest('.header-main').outerHeight() - 100)){ nextMenu.css({ height: nextMenu.outerHeight() + nextMenu.find('> li').outerHeight() }); } nextMenu.css({ 'padding-top': nextMenuHeightDiff + 'px' }); }, menuNav: function(){ var self=this; self.$mainNav.find('.menu-item-has-children > a.nolink').removeClass('nolink').attr('href', ''); self.$mainNav.find('.menu-item-has-children > a:not(.go-back)').off('click').on('click', function(e){ e.stopImmediatePropagation(); e.preventDefault(); var $this=$(this); if(js_porto_vars.lazyload_menu&&!self.$mainNav.hasClass('sub-ready')){ self.initSub($this); self.$mainNav.on('sub-loaded', function(){ self.initSub($this); }); }else{ self.initSub($this); }}); }}; slideNavigation.build(); } if(parent_toogle_wrap){ parent_toogle_wrap.style.display=''; parent_toogle_wrap.style.visibility=''; } return self; }, events: function(){ var self=this; self.$toggle.on('click', function(){ var $widget=$(this).parent().parent(); var $this=$(this); if($this.hasClass('closed')){ $this.removeClass('closed'); $widget.removeClass('closed'); $widget.find('.sidebar-menu-wrap').stop().slideDown(400, function(){ $(this).attr('style', '').show(); self.build(); }); }else{ $this.addClass('closed'); $widget.addClass('closed'); $widget.find('.sidebar-menu-wrap').stop().slideUp(400, function(){ $(this).attr('style', '').hide(); }); }}); this.$menu_toggle.on('click', function(){ var $toggle_menu=$(this).parent(); if($toggle_menu.hasClass('show-always')||$toggle_menu.hasClass('show-hover')){ return; } var $this=$(this); if($this.hasClass('closed')){ $this.removeClass('closed'); $toggle_menu.removeClass('closed'); $toggle_menu.find('.toggle-menu-wrap').stop().slideDown(400, function(){ $(this).attr('style', '').show(); }); self.build(); }else{ $this.addClass('closed'); $toggle_menu.addClass('closed'); $toggle_menu.find('.toggle-menu-wrap').stop().slideUp(400, function(){ $(this).attr('style', '').hide(); }); }}); if(self.$menu.hasClass('side-menu-slide')){ self.$menu.on('click', '.go-back', function(e){ e.preventDefault(); var prevMenu=$(this).closest('.next-menu'), prevMenuHeightDiff=0; if(prevMenu.length&&prevMenu.find('> li').length){ prevMenuHeightDiff=prevMenu.find('> li').length * prevMenu.find('> li').outerHeight() - prevMenu.outerHeight(); } prevMenu.removeClass('next-menu'); $(this).closest('ul').removeClass('visible'); if(prevMenuHeightDiff > 0){ prevMenu.css({ overflow: 'hidden', 'overflow-y': 'scroll' }); }}); } if($('.sidebar-menu:not(.side-menu-accordion)').closest('[data-plugin-sticky]').length){ var sidebarRefreshTimer; $(window).smartresize(function(){ if(sidebarRefreshTimer){ clearTimeout(sidebarRefreshTimer); } sidebarRefreshTimer=setTimeout(function(){ self.build(); }, 800); }); }else{ $(window).smartresize(function(){ self.build(); }); } setTimeout(function(){ self.build(); }, 400); return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { StickyHeader: { defaults: { header: $('#header') }, initialize: function($header){ this.$header=($header||this.defaults.header); this.sticky_height=0; this.sticky_pos=0; this.change_logo=theme.change_logo; if(!theme.show_sticky_header||!this.$header.length||$('.side-header-narrow-bar').length) return this; var self=this; var $menu_wrap=self.$header.find('> .main-menu-wrap'); if($menu_wrap.length){ self.$menu_wrap=$menu_wrap; self.menu_height=$menu_wrap.height(); }else{ self.$menu_wrap=false; } self.$header_main=self.$header.find('.header-main'); if(!self.$header_main.length&&self.$header.children('.elementor-location-header').length){ self.$header_main=self.$header.children('.elementor-location-header').last().addClass('header-main'); } if(!self.$header_main.length){ return this; } self.reveal=self.$header.parents('.header-wrapper').hasClass('header-reveal'); self.is_sticky=false; self.reset() .build() .events(); return self; }, build: function(){ var self=this; if(!self.is_sticky&&(window.innerHeight + self.header_height + theme.adminBarHeight() + parseInt(self.$header.css('border-top-width')) >=$(document).height())){ return self; } if(window.innerHeight > $(document.body).height()) window.scrollTo(0, 0); var scroll_top=$(window).scrollTop(); if(self.$menu_wrap&&!theme.isTablet()){ self.$header_main.stop().css('top', 0); if(self.$header.parent().hasClass('fixed-header')) self.$header.parent().attr('style', ''); if(scroll_top > self.sticky_pos){ if(!self.$header.hasClass('sticky-header')){ var header_height=self.$header.outerHeight(); self.$header.addClass('sticky-header').css('height', header_height); self.$menu_wrap.stop().css('top', theme.adminBarHeight()); var selectric=self.$header.find('.header-main .searchform select').data('selectric'); if(selectric&&typeof selectric.close!='undefined') selectric.close(); if(self.$header.parent().hasClass('fixed-header')){ self.$header_main.hide(); self.$header.css('height', ''); } if(!self.init_toggle_menu){ self.init_toggle_menu=true; theme.MegaMenu.build(); if($('#main-toggle-menu').length){ if($('#main-toggle-menu').hasClass('show-always')){ $('#main-toggle-menu').data('show-always', true); $('#main-toggle-menu').removeClass('show-always'); } $('#main-toggle-menu').addClass('closed'); $('#main-toggle-menu .menu-title').addClass('closed'); $('#main-toggle-menu .toggle-menu-wrap').attr('style', ''); }} self.is_sticky=true; }}else{ if(self.$header.hasClass('sticky-header')){ self.$header.removeClass('sticky-header'); self.$header.css('height', ''); self.$menu_wrap.stop().css('top', 0); self.$header_main.show(); var selectric=self.$header.find('.main-menu-wrap .searchform select').data('selectric'); if(selectric&&typeof selectric.close!='undefined') selectric.close(); if(self.init_toggle_menu){ self.init_toggle_menu=false; theme.MegaMenu.build(); if($('#main-toggle-menu').length){ if($('#main-toggle-menu').data('show-always')){ $('#main-toggle-menu').addClass('show-always'); $('#main-toggle-menu').removeClass('closed'); $('#main-toggle-menu .menu-title').removeClass('closed'); $('#main-toggle-menu .toggle-menu-wrap').attr('style', ''); }} } self.is_sticky=false; }} }else{ self.$header_main.show(); if(self.$header.parent().hasClass('fixed-header')&&$('#wpadminbar').length&&$('#wpadminbar').css('position')=='absolute'){ self.$header.parent().css('top',($('#wpadminbar').height() - scroll_top) < 0 ? -$('#wpadminbar').height():-scroll_top); }else if(self.$header.parent().hasClass('fixed-header')){ self.$header.parent().attr('style', ''); }else{ if(self.$header.parent().hasClass('fixed-header')) self.$header.parent().attr('style', ''); } if(self.$header.hasClass('sticky-menu-header')&&!theme.isTablet()){ self.$header_main.stop().css('top', 0); if(self.change_logo) self.$header_main.removeClass('change-logo'); self.$header_main.removeClass('sticky'); self.$header.removeClass('sticky-header'); self.is_sticky=false; self.sticky_height=0; }else{ if(self.$menu_wrap) self.$menu_wrap.stop().css('top', 0); if(scroll_top > self.sticky_pos&&(!theme.isTablet()||(theme.isTablet()&&(!theme.isMobile()&&theme.show_sticky_header_tablet)||(theme.isMobile()&&theme.show_sticky_header_tablet&&theme.show_sticky_header_mobile)))){ if(!self.$header.hasClass('sticky-header')){ var header_height=self.$header.outerHeight(); self.$header.addClass('sticky-header').css('height', header_height); self.$header_main.addClass('sticky'); if(self.change_logo) self.$header_main.addClass('change-logo'); self.$header_main.stop().css('top', theme.adminBarHeight()); if(!self.init_toggle_menu){ self.init_toggle_menu=true; theme.MegaMenu.build(); if($('#main-toggle-menu').length){ if($('#main-toggle-menu').hasClass('show-always')){ $('#main-toggle-menu').data('show-always', true); $('#main-toggle-menu').removeClass('show-always'); } $('#main-toggle-menu').addClass('closed'); $('#main-toggle-menu .menu-title').addClass('closed'); $('#main-toggle-menu .toggle-menu-wrap').attr('style', ''); }} self.is_sticky=true; }}else{ if(self.$header.hasClass('sticky-header')){ if(self.change_logo) self.$header_main.removeClass('change-logo'); self.$header_main.removeClass('sticky'); self.$header.removeClass('sticky-header'); self.$header.css('height', ''); self.$header_main.stop().css('top', 0); if(self.init_toggle_menu){ self.init_toggle_menu=false; theme.MegaMenu.build(); if($('#main-toggle-menu').length){ if($('#main-toggle-menu').data('show-always')){ $('#main-toggle-menu').addClass('show-always'); $('#main-toggle-menu').removeClass('closed'); $('#main-toggle-menu .menu-title').removeClass('closed'); $('#main-toggle-menu .toggle-menu-wrap').attr('style', ''); }} } self.is_sticky=false; }} }} if(!self.$header.hasClass('header-loaded')) self.$header.addClass('header-loaded'); if(!self.$header.find('.logo').hasClass('logo-transition')) self.$header.find('.logo').addClass('logo-transition'); if(self.$header.find('.overlay-logo').get(0)&&!self.$header.find('.overlay-logo').hasClass('overlay-logo-transition')) self.$header.find('.overlay-logo').addClass('overlay-logo-transition'); return self; }, reset: function(){ var self=this; if(self.$header.find('.logo').hasClass('logo-transition')) self.$header.find('.logo').removeClass('logo-transition'); if(self.$header.find('.overlay-logo').get(0)&&self.$header.find('.overlay-logo').hasClass('overlay-logo-transition')) self.$header.find('.overlay-logo').removeClass('overlay-logo-transition'); if(self.$menu_wrap&&!theme.isTablet()){ self.$header.addClass('sticky-header sticky-header-calc'); self.$header_main.addClass('sticky'); if(self.change_logo) self.$header_main.addClass('change-logo'); self.sticky_height=self.$menu_wrap.height() + parseInt(self.$menu_wrap.css('padding-top')) + parseInt(self.$menu_wrap.css('padding-bottom')); if(self.change_logo) self.$header_main.removeClass('change-logo'); self.$header_main.removeClass('sticky'); self.$header.removeClass('sticky-header sticky-header-calc'); self.header_height=self.$header.height() + parseInt(self.$header.css('margin-top')); self.menu_height=self.$menu_wrap.height() + parseInt(self.$menu_wrap.css('padding-top')) + parseInt(self.$menu_wrap.css('padding-bottom')); self.sticky_pos=(self.header_height - self.sticky_height) + parseInt($('body').css('padding-top')) + parseInt(self.$header.css('border-top-width')); if($('.banner-before-header').length){ self.sticky_pos +=$('.banner-before-header').height(); } if($('.porto-block-html-top').length){ self.sticky_pos +=$('.porto-block-html-top').height(); }}else{ self.$header.addClass('sticky-header sticky-header-calc'); self.$header_main.addClass('sticky'); if(self.change_logo) self.$header_main.addClass('change-logo'); self.sticky_height=self.$header_main.outerHeight(); if(self.change_logo) self.$header_main.removeClass('change-logo'); self.$header_main.removeClass('sticky'); self.$header.removeClass('sticky-header sticky-header-calc'); self.header_height=self.$header.height() + parseInt(self.$header.css('margin-top')); self.main_height=self.$header_main.height(); if(!(!theme.isTablet()||(theme.isTablet()&&!theme.isMobile()&&theme.show_sticky_header_tablet)||(theme.isMobile()&&theme.show_sticky_header_tablet&&theme.show_sticky_header_mobile))){ self.sticky_height=0; } self.sticky_pos=self.$header.offset().top + self.header_height - self.sticky_height - theme.adminBarHeight() + parseInt(self.$header.css('border-top-width')); } if(self.reveal){ if(self.menu_height){ self.sticky_pos +=self.menu_height + 30; }else{ self.sticky_pos +=30; }} if(self.sticky_pos < 0){ self.sticky_pos=0; } self.init_toggle_menu=false; self.$header_main.removeAttr('style'); if(!theme.isTablet()&&self.$header.hasClass('header-side')&&typeof self.$header.attr('data-plugin-sticky')!='undefined'){ self.$header.css('height', ''); }else{ self.$header.removeAttr('style'); } return self; }, events: function(){ var self=this, win_width=0; $(window).smartresize(function(){ if(win_width!=window.innerWidth){ self.reset().build(); win_width=window.innerWidth; }}); window.addEventListener('scroll', function(){ theme.requestFrame(function(){ self.build(); }); }, { passive: true }); return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { SideNav: { defaults: { side_nav: $('.header-side-nav #header') }, bc_pos_top: 0, initialize: function($side_nav){ this.$side_nav=($side_nav||this.defaults.side_nav); if(!this.$side_nav.length) return this; var self=this; self.$side_nav.addClass('initialize'); self.reset() .build() .events(); return self; }, build: function(){ var self=this; var $page_top=$('.page-top'), $main=$('#main'); if(theme.isTablet()){ $page_top.removeClass("fixed-pos"); $page_top.attr('style', ''); $main.attr('style', ''); }else{ var scroll_top=$(window).scrollTop(); if($page_top.length&&$page_top.outerHeight() < 100&&!$('.side-header-narrow-bar-top').length){ if(self.page_top_offset==theme.adminBarHeight()||self.page_top_offset <=scroll_top){ if(!$page_top.hasClass("fixed-pos")){ $page_top.addClass("fixed-pos"); $page_top.css('top', theme.adminBarHeight()); $main.css('padding-top', $page_top.outerHeight()); }}else{ if($page_top.hasClass("fixed-pos")){ $page_top.removeClass("fixed-pos"); $page_top.attr('style', ''); $main.attr('style', ''); }} } $main.css('min-height', window.innerHeight - theme.adminBarHeight() - $('.page-top:not(.fixed-pos)').height() - $('.footer-wrapper').height()); } return self; }, reset: function(){ var self=this; if(theme.isTablet()){ self.$side_nav.attr('style', ''); }else{ var w_h=window.innerHeight, $side_bottom=self.$side_nav.find('.side-bottom'); self.$side_nav.css({ 'min-height': w_h - theme.adminBarHeight(), 'padding-bottom': $side_bottom.length ? $side_bottom.height() + parseInt($side_bottom.css('margin-top')) + parseInt($side_bottom.css('margin-bottom')):'' }); var appVersion=navigator.appVersion; var webkitVersion_positionStart=appVersion.indexOf("AppleWebKit/") + 12; var webkitVersion_positionEnd=webkitVersion_positionStart + 3; var webkitVersion=appVersion.slice(webkitVersion_positionStart, webkitVersion_positionEnd); if(webkitVersion < 537){ self.$side_nav.css('-webkit-backface-visibility', 'hidden'); self.$side_nav.css('-webkit-perspective', '1000'); }} var $page_top=$('.page-top'), $main=$('#main'); if($page_top.length){ $page_top.removeClass("fixed-pos"); $page_top.attr('style', ''); $main.attr('style', ''); self.page_top_offset=$page_top.offset().top; } return self; }, events: function(){ var self=this; $(window).on('resize', function(){ self.reset() .build(); }); window.addEventListener('scroll', function(){ self.build(); }, { passive: true }); if($('.side-header-narrow-bar-top').length){ if($(window).scrollTop() > theme.adminBarHeight() + $('.side-header-narrow-bar-top').height()){ $('.side-header-narrow-bar-top').addClass('side-header-narrow-bar-sticky'); } window.addEventListener('scroll', function(){ var scroll_top=$(this).scrollTop(); if(scroll_top > theme.adminBarHeight() + $('.side-header-narrow-bar-top').height()){ $('.side-header-narrow-bar-top').addClass('side-header-narrow-bar-sticky'); }else{ $('.side-header-narrow-bar-top').removeClass('side-header-narrow-bar-sticky'); }}, { passive: true }); } $('.side-header-narrow-bar .hamburguer-btn').on('click', function(){ $(this).toggleClass('active'); $('#header').toggleClass('side-header-visible'); if($(this).closest('.side-header-narrow-bar-top').length&&!$('#header > .hamburguer-btn').length){ $(this).closest('.side-header-narrow-bar-top').toggle(); }}); $('.hamburguer-close').on('click', function(){ $('.side-header-narrow-bar .hamburguer-btn').trigger('click'); }); return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { Search: { defaults: { popup: $('.searchform-popup'), form: $('.searchform') }, initialize: function($popup, $form){ this.$popup=($popup||this.defaults.popup); this.$form=($form||this.defaults.form); this.build() .events(); return this; }, build: function(){ var self=this; var $search_form_texts=self.$form.find('.text input'), $search_form_cats=self.$form.find('.cat'); if($('.searchform .cat').get(0)&&$.fn.selectric){ $('.searchform .cat').selectric({ arrowButtonMarkup: '', expandToItemText: true, maxHeight: 240 }); } $search_form_texts.on('change', function(){ var $this=$(this), val=$this.val(); $search_form_texts.each(function(){ if($this!=$(this)) $(this).val(val); }); }); $search_form_cats.on('change', function(){ var $this=$(this), val=$this.val(); $search_form_cats.each(function(){ if($this!=$(this)) $(this).val(val); }); }); return this; }, events: function(){ var self=this; self.$popup.on('click', function(e){ e.stopPropagation(); }); self.$popup.find('.search-toggle').on('click', function(e){ e.preventDefault(); $(this).toggleClass('opened'); $(this).next().toggle(); if($(this).hasClass('opened')){ $('#mini-cart.open').removeClass('open'); $(this).next().find('input[type="text"]').focus(); if(self.$popup.find('.btn-close-search-form').length){ self.$popup.parent().addClass('position-static'); }} e.preventDefault(); e.stopPropagation(); }); $('html,body').on('click', function(){ self.removeFormStyle(); }); if(!('ontouchstart' in document)){ $(window).on('resize', function(){ self.removeFormStyle(); }); } $('.btn-close-search-form').on('click', function(e){ e.preventDefault(); self.removeFormStyle(); }); return self; }, removeFormStyle: function(){ this.$form.removeAttr('style'); this.$popup.find('.search-toggle').removeClass('opened'); if(this.$popup.find('.btn-close-search-form').length){ this.$popup.parent().removeClass('position-static'); }} }}); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { HashScroll: { initialize: function(){ this.build() .events(); return this; }, build: function(){ var self=this; try { var hash=window.location.hash; var target=$(hash); if(target.length&&!(hash=='#review_form'||hash=='#reviews'||hash.indexOf('#comment-')!=-1)){ $('html, body').delay(600).stop().animate({ scrollTop: target.offset().top - theme.StickyHeader.sticky_height - theme.adminBarHeight() - theme.sticky_nav_height + 1 }, 600, 'easeOutQuad'); } return self; } catch(err){ return self; }}, getTarget: function(href){ if('#'==href||href.endsWith('#')){ return false; } var target; if(href.indexOf('#')==0){ target=$(href); }else{ var url=window.location.href; url=url.substring(url.indexOf('://') + 3); if(url.indexOf('#')!=-1) url=url.substring(0, url.indexOf('#')); href=href.substring(href.indexOf('://') + 3); href=href.substring(href.indexOf(url) + url.length); if(href.indexOf('#')==0){ target=$(href); }} return target; }, activeMenuItem: function(){ var self=this; var scroll_pos=$(window).scrollTop(); var $menu_items=$('.menu-item > a[href*="#"], .porto-sticky-nav .nav > li > a[href*="#"]'); if($menu_items.length){ $menu_items.each(function(){ var $this=$(this), href=$this.attr('href'), target=self.getTarget(href); if(target&&target.get(0)){ if($this.parent().is(':last-child')&&scroll_pos + window.innerHeight >=target.offset().top + target.outerHeight()){ $this.parent().siblings().removeClass('active'); $this.parent().addClass('active'); }else{ var scroll_to=target.offset().top - theme.StickyHeader.sticky_height - theme.adminBarHeight() - theme.sticky_nav_height + 1, $parent=$this.parent(); if(scroll_to <=scroll_pos + 5){ $parent.siblings().removeClass('active'); $parent.addClass('active'); if($parent.closest('.secondary-menu').length){ $parent.closest('#header').find('.main-menu').eq(0).children('.menu-item.active').removeClass('active'); }}else{ $parent.removeClass('active'); }} }}); } return self; }, events: function(){ var self=this; $('.menu-item > a[href*="#"], .porto-sticky-nav .nav > li > a[href*="#"], a[href*="#"].hash-scroll, .hash-scroll-wrap a[href*="#"]').on('click', function(e){ e.preventDefault(); var $this=$(this), href=$this.attr('href'), target=self.getTarget(href); if(target&&target.get(0)){ var $parent=$this.parent(); var scroll_to=target.offset().top - theme.StickyHeader.sticky_height - theme.adminBarHeight() - theme.sticky_nav_height + 1; $('html, body').stop().animate({ scrollTop: scroll_to }, 600, 'easeOutQuad', function(){ $parent.siblings().removeClass('active'); $parent.addClass('active'); }); if($this.closest('.porto-popup-menu.opened').length){ $this.closest('.porto-popup-menu.opened').children('.hamburguer-btn').trigger('click'); }}else if(( '#'!=href||!$this.closest('.porto-popup-menu.opened').length)&&!$this.hasClass('nolink')){ window.location.href=$this.attr('href'); }}); var $menu_items=$('.menu-item > a[href*="#"], .porto-sticky-nav .nav > li > a[href*="#"]'); $menu_items.each(function(){ var rootMargin='-20% 0px -79.9% 0px', isLast=$(this).parent().is(':last-child'); if(isLast){ var obj=document.getElementById(this.hash.replace('#', '')); if(obj&&document.body.offsetHeight - obj.offsetTop < window.innerHeight){ var ratio=(window.innerHeight - document.body.offsetHeight + obj.offsetTop) / window.innerHeight * 0.8; ratio=Math.round(ratio * 100); rootMargin='-' +(20 + ratio) + '% 0px -' +(79.9 - ratio) + '% 0px'; }} var callback=function(){ if(this&&typeof this[0]!='undefined'&&this[0].id){ $('.menu-item > a[href*="#' + this[0].id + '"], .porto-sticky-nav .nav > li > a[href*="#' + this[0].id + '"]').parent().addClass('active').siblings().removeClass('active'); }}; self.scrollSpyIntObs(this.hash, callback, { rootMargin: rootMargin, thresholds: 0 }, true, isLast, true, $menu_items, $(this).parent().index()); }); return self; }, scrollSpyIntObs: function(selector, functionName, intObsOptions, alwaysObserve, isLast, firstLoad, $allItems, index){ if(typeof IntersectionObserver=='undefined'){ return this; } var obj=document.getElementById(selector.replace('#', '')); if(!obj){ return this; } var self=this; var intersectionObserverOptions={ rootMargin: '0px 0px 200px 0px' } if(Object.keys(intObsOptions).length){ intersectionObserverOptions=$.extend(intersectionObserverOptions, intObsOptions); } var observer=new IntersectionObserver(function(entries){ for(var i=0; i < entries.length; i++){ var entry=entries[i]; if(entry.intersectionRatio > 0){ if(typeof functionName==='string'){ var func=Function('return ' + functionName)(); }else{ var callback=functionName; callback.call($(entry.target)); }}else{ if(firstLoad==false){ if(isLast){ $allItems.filter('[href*="' + entry.target.id + '"]').parent().prev().addClass('active').siblings().removeClass('active'); }} firstLoad=false; }} }, intersectionObserverOptions); observer.observe(obj); return this; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { SortFilter: { defaults: { filters: '.porto-sort-filters ul', elements: '.porto-sort-container .row' }, initialize: function($elements, $filters){ this.$elements=($elements||$(this.defaults.elements)); this.$filters=($filters||$(this.defaults.filters)); this.build(); return this; }, build: function(){ var self=this; self.$elements.each(function(){ var $this=$(this); $this.isotope({ itemSelector: '.porto-sort-item', layoutMode: 'masonry', getSortData: { popular: '[data-popular] parseInt' }, sortBy: 'popular', isOriginLeft: !theme.rtl }); imagesLoaded(this, function(){ if($this.data('isotope')){ $this.isotope('layout'); }}); }); self.$filters.each(function(){ var $this=$(this); var id=$this.attr('data-sort-id'); var $container=$('#' + id); if($container.length){ $this.on('click', 'li', function(e){ e.preventDefault(); var $that=$(this); $this.find('li').removeClass('active'); $that.addClass("active"); var sortByValue=$that.attr('data-sort-by'); $container.isotope({ sortBy: sortByValue }); var filterByValue=$that.attr('data-filter-by'); if(filterByValue){ $container.isotope({ filter: filterByValue }); }else{ $container.isotope({ filter: '.porto-sort-item' }); } theme.refreshVCContent(); }); $this.find('li[data-active]').trigger('click'); }}); return self; }} }); }).apply(this, [window.theme, jQuery]); (function($){ var $footerReveal={ $wrapper: $('.footer-reveal'), init: function(){ var self=this; self.build(); self.events(); }, build: function(){ var self=this, footer_height=self.$wrapper.outerHeight(true), window_height=window.innerHeight - theme.adminBarHeight(); if($('#header .header-main').length){ window_height -=$('#header .header-main').height(); } if(footer_height > window_height){ $('.footer-wrapper').removeClass('footer-reveal'); $('.page-wrapper').css('margin-bottom', 0); }else{ $('.footer-wrapper').addClass('footer-reveal'); $('.page-wrapper').css('margin-bottom', footer_height); if(document.body.offsetHeight < window.innerHeight){ document.body.style.paddingBottom='0.1px'; }} }, events: function(){ var self=this, $window=$(window); $window.smartresize(function(){ self.build(); }); }} if($('.footer-reveal').get(0)){ $footerReveal.init(); }})(jQuery); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__floatElement'; var PluginFloatElement=function($el, opts){ return this.initialize($el, opts); }; PluginFloatElement.defaults={ startPos: 'top', speed: 3, horizontal: false, circle: false, transition: false, transitionDelay: 0, transitionDuration: 500 }; PluginFloatElement.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginFloatElement.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.wrapper, $window=$(window), minus; if(self.options.style){ $el.attr('style', self.options.style); } if(self.options.circle){ if(self.options.transition){ $el.css({ transition: 'ease-out transform ' + self.options.transitionDuration + 'ms ' + self.options.transitionDelay + 'ms' }); } window.addEventListener('scroll', function(){ self.movement(minus); }, { passive: true }); }else if($window.width() > 767){ if(self.options.startPos=='none'){ minus=''; }else if(self.options.startPos=='top'){ $el.css({ top: 0 }); minus=''; }else{ $el.css({ bottom: 0 }); minus='-'; } if(self.options.transition){ $el.css({ transition: 'ease-out transform ' + self.options.transitionDuration + 'ms ' + self.options.transitionDelay + 'ms' }); } self.movement(minus); window.addEventListener('scroll', function(){ self.movement(minus); }, { passive: true }); } return this; }, movement: function(minus){ var self=this, $el=this.options.wrapper, $window=$(window), scrollTop=$window.scrollTop(), elementOffset=$el.offset().top, currentElementOffset=(elementOffset - scrollTop); if(self.options.circle){ $el.css({ transform: 'rotate(' +(scrollTop * 0.25) + 'deg)' }); }else{ var scrollPercent=100 * currentElementOffset /($window.height()); if(elementOffset + $el.height() >=scrollTop&&elementOffset <=scrollTop + window.innerHeight){ if(!self.options.horizontal){ $el.css({ transform: 'translate3d(0, ' + minus + scrollPercent / self.options.speed + '%, 0)' }); }else{ $el.css({ transform: 'translate3d(' + minus + scrollPercent / self.options.speed + '%, 0, 0)' }); }} }} }; $.extend(theme, { PluginFloatElement: PluginFloatElement }); $.fn.themePluginFloatElement=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginFloatElement($this, opts); }}); }}).apply(this, [window.theme, jQuery]); function porto_init($wrap){ 'use strict'; jQuery(window).on('touchstart', function(){ }); if(!$wrap){ $wrap=jQuery(document.body); } var wrapObj=$wrap.get(0); $wrap.trigger('porto_init_start', [wrapObj]); (function($){ if($.fn.themeAccordion){ $(function(){ $wrap.find('.accordion:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeAccordion(opts); }); }); } if($.fn.themeAccordionMenu){ $(function(){ $wrap.find('.accordion-menu:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeAccordionMenu(opts); }); }); } if($.fn.themeChartCircular){ var $objects=wrapObj.querySelectorAll('[data-plugin-chart-circular]:not(.manual), .circular-bar-chart:not(.manual)'); if($objects.length){ theme.dynIntObsInit($objects, 'themeChartCircular', theme.ChartCircular.defaults); }} if($.fn.themeFitVideo){ $(function(){ $wrap.find('.fit-video:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeFitVideo(opts); }); }); } if($.fn.themePluginVideoBackground){ $(function(){ $wrap.find('[data-plugin-video-background]:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=theme.getOptions($this.data('plugin-options')); if(pluginOptions) opts=pluginOptions; $this.themePluginVideoBackground(opts); }); }); } if($.fn.themeFlickrZoom){ $(function(){ $wrap.find('.wpb_flickr_widget:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeFlickrZoom(opts); }); }); } if($.fn.themePluginLazyLoad){ $(function(){ $wrap.find('[data-plugin-lazyload]:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themePluginLazyLoad(opts); }); if($wrap.find('.porto-lazyload').length){ $wrap.find('.porto-lazyload').filter(function(){ if($(this).data('__lazyload')||($(this).closest('.owl-carousel').length&&$(this).closest('.owl-carousel').find('.owl-item.cloned').length)){ return false; } return true; }).themePluginLazyLoad({ effect: 'fadeIn', effect_speed: 400 }); if($wrap.find('.porto-lazyload').closest('.nivoSlider').length){ theme.requestTimeout(function(){ $wrap.find('.nivoSlider').each(function(){ if($(this).find('.porto-lazyload').length){ $(this).closest('.nivoSlider').find('.nivo-main-image').attr('src', $(this).closest('.nivoSlider').find('.porto-lazyload').eq(0).attr('src')); }}); }, 100); } if($wrap.find('.porto-lazyload').closest('.porto-carousel-wrapper').length){ theme.requestTimeout(function(){ $wrap.find('.porto-carousel-wrapper').each(function(){ if($(this).find('.porto-lazyload:not(.lazy-load-loaded)').length){ $(this).find('.slick-list').css('height', 'auto'); }}); }, 100); }} }); } if($.fn.themeMasonry){ $(function(){ $wrap.find('[data-plugin-masonry]:not(.manual)').each(function(){ var $this=$(this), opts; if($this.hasClass('elementor-row')){ $this.children('.elementor-column').addClass('porto-grid-item'); } var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeMasonry(opts); }); $wrap.find('.posts-masonry .posts-container:not(.manual)').each(function(){ var pluginOptions=$(this).data('plugin-options'); if(!pluginOptions){ pluginOptions={};} pluginOptions.itemSelector='.post'; $(this).themeMasonry(pluginOptions); }); $wrap.find('.page-portfolios .portfolio-row:not(.manual)').each(function(){ if($(this).closest('.porto-grid-container').length > 0||typeof $(this).attr('data-plugin-masonry')!='undefined'){ return; } var $parent=$(this).parent(), layoutMode='masonry', options, columnWidth='.portfolio:not(.w2)', timer=null; if($parent.hasClass('portfolios-grid')){ }else if($parent.hasClass('portfolios-masonry')){ if(!$parent.children('.bounce-loader').length){ $parent.append('
'); }} options={ itemSelector: '.portfolio', layoutMode: layoutMode, callback: function(){ timer&&clearTimeout(timer); timer=setTimeout(function(){ if(typeof theme.FilterZoom!=='undefined'){ theme.FilterZoom.initialize($('.page-portfolios')); } $parent.addClass('portfolio-iso-active'); }, 400); }}; if(layoutMode=='masonry'){ if(!$parent.find('.portfolio:not(.w2)').length) columnWidth='.portfolio'; options=$.extend(true, {}, options, { masonry: { columnWidth: columnWidth }}); } $(this).themeMasonry(options); }); $wrap.find('.page-members .member-row:not(.manual)').each(function(){ $(this).themeMasonry({ itemSelector: '.member', callback: function(){ setTimeout(function(){ if(typeof theme.FilterZoom!=='undefined'){ theme.FilterZoom.initialize($('.page-members')); }}, 400); }}); }); }); } if($.fn.themePreviewImage){ $(function(){ $wrap.find('.thumb-info-preview .thumb-info-image:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themePreviewImage(opts); }); }); } if($.fn.themeToggle){ $(function(){ $wrap.find('section.toggle:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeToggle(opts); }); }); } if($.fn.themeParallax){ $(function(){ $wrap.find('[data-plugin-parallax]:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'), parallaxScale=$this.attr('data-parallax-scale'); if(pluginOptions) opts=pluginOptions; if(typeof parallaxScale!=='undefined'){ opts['scale']=true; if(parallaxScale=='invert'){ opts['scaleInvert']=true; }} $this.themeParallax(opts); }); }); } if($.fn.themePluginInViewportStyle){ $(function(){ $wrap.find('[data-inviewport-style]:not(.manual)').each(function(){ var $this=$(this), opts=$this.data('plugin-options'); $this.themePluginInViewportStyle(opts); }); }); } if($.fn.themeSticky){ $(function(){ $wrap.find('[data-plugin-sticky]:not(.manual), .porto-sticky:not(.manual), .porto-sticky-nav:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; if($this.is(':visible')){ $this.themeSticky(opts); }}); }); } if($.fn['themePluginFloatElement']){ $(function(){ $wrap.find('[data-plugin-float-element]:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=theme.getOptions($this.data('plugin-options')); if(pluginOptions) opts=pluginOptions; $this.themePluginFloatElement(opts); }); }); } if(typeof bootstrap!='undefined'){ var tooltipTriggerList=[].slice.call(wrapObj.querySelectorAll("[data-bs-tooltip]:not(.manual), [data-toggle='tooltip']:not(.manual), .star-rating:not(.manual)")); tooltipTriggerList.map(function(tooltipTriggerEl){ return new bootstrap.Tooltip(tooltipTriggerEl) }); var popoverTriggerList=[].slice.call(wrapObj.querySelectorAll("[data-toggle='popover']")); popoverTriggerList.map(function(popoverTriggerEl){ return new bootstrap.Popover(popoverTriggerEl) }); } $wrap.find('a[data-bs-toggle="tab"]').off('shown.bs.tab').on('shown.bs.tab', function(e){ $(this).parents('.nav-tabs').find('.active').removeClass('active'); $(this).addClass('active').parent().addClass('active'); }); if($.fn.vcwaypoint){ $wrap.find('.vc_progress_bar').each(function(){ var $this=$(this); if(!$this.find('.progress-bar-tooltip').length){ return; } $this.vcwaypoint(function(){ var $tooltips=$this.find('.progress-bar-tooltip'), index=0, count=$tooltips.length; function loop(){ theme.requestTimeout(function(){ $tooltips.animate({ opacity: 1 }); }, 200); index++; if(index < count){ loop(); }} loop(); }, { offset: '85%' }); }); } if(typeof theme.initAsync=='function'){ theme.initAsync($wrap, wrapObj); }else{ $(document.body).on('porto_async_init', function(){ theme.initAsync($wrap, wrapObj); }); }})(jQuery); jQuery(document.body).trigger('porto_init', [$wrap]); } (function(theme, $){ 'use strict'; $(document).ready(function(){ var win_width=0; $(window).smartresize(function(){ if(win_width!=window.innerWidth){ theme.adminBarHeightNum=null; win_width=window.innerWidth; }}); if(typeof theme.ScrollToTop!=='undefined'){ theme.ScrollToTop.initialize(); } setTimeout(function(){ porto_init(); }, 0); (function(){ theme.bodyWidth=theme.bodyWidth||document.body.offsetWidth; if(typeof theme.MegaMenu!=='undefined'){ theme.MegaMenu.initialize(); } if(typeof theme.SidebarMenu!=='undefined'){ theme.SidebarMenu.initialize(); $('.sidebar-menu.side-menu-accordion').themeAccordionMenu({ 'open_one': true }); }})(); (function(){ if($('.porto-popup-menu').length){ $('.porto-popup-menu .hamburguer-btn').on('click', function(e){ e.preventDefault(); var $this=$(this); if($('.porto-popup-menu-spacer').length){ $('.porto-popup-menu-spacer').remove(); }else{ $('
').insertBefore($this.parent()); $('.porto-popup-menu-spacer').width($this.parent().width()); } $this.parent().toggleClass('opened'); theme.requestFrame(function(){ $this.toggleClass('active'); }); }); $('.porto-popup-menu .main-menu').scrollbar(); $('.porto-popup-menu').on('click', 'li.menu-item-has-children > a', function(e){ e.preventDefault(); $(this).parent().siblings('li.menu-item-has-children.opened').removeClass('opened'); $(this).parent().toggleClass('opened'); }); } if(js_porto_vars.lazyload_menu){ var menu_type, $menu_obj; if($('.secondary-menu.mega-menu').length){ menu_type='secondary_menu'; $menu_obj=$('.secondary-menu.mega-menu'); menu_lazyload($menu_obj, menu_type); } if($('.mega-menu.main-menu:not(.scroll-wrapper):not(.secondary-menu)').length){ menu_type='main_menu'; $menu_obj=$('.mega-menu.main-menu:not(.scroll-wrapper):not(.secondary-menu)'); menu_lazyload($menu_obj, menu_type); } if($('.toggle-menu-wrap .sidebar-menu').length){ menu_type='toggle_menu'; $menu_obj=$('.toggle-menu-wrap .sidebar-menu'); menu_lazyload($menu_obj, menu_type); } if($('.main-sidebar-menu .sidebar-menu').length){ menu_type='sidebar_menu'; $menu_obj=$('.main-sidebar-menu .sidebar-menu'); $menu_obj.each(function(){ let $menu_item=$(this); menu_lazyload($menu_item, menu_type, $menu_item.closest('.main-sidebar-menu').data('menu')); }); } if($('.header-side-nav .sidebar-menu').length){ menu_type='header_side_menu'; $menu_obj=$('.header-side-nav .sidebar-menu'); menu_lazyload($menu_obj, menu_type); } if($('#nav-panel .skeleton-body, #side-nav-panel .skeleton-body').length&&'pageload'==js_porto_vars.lazyload_menu){ theme.lazyload_menu(1, 'mobile_menu'); } function menu_lazyload($menu_item, menu_type, menu_id){ var porto_menu_loaded=false; if('pageload'==js_porto_vars.lazyload_menu){ theme.lazyload_menu($menu_item, menu_type, menu_id); }else if('firsthover'==js_porto_vars.lazyload_menu){ $menu_item.one('mouseenter touchstart', 'li.menu-item-has-children', function(){ if(porto_menu_loaded){ return true; } theme.lazyload_menu($menu_item, menu_type, menu_id); porto_menu_loaded=true; }); }} } if(typeof theme.SideNav!=='undefined'){ theme.SideNav.initialize(); }})(); setTimeout(()=> { if(typeof theme.StickyHeader!=='undefined'){ theme.StickyHeader.initialize(); } if(typeof theme.HashScroll!=='undefined'){ theme.HashScroll.initialize(); }}); if(js_porto_vars.use_skeleton_screen.length > 0&&$('.skeleton-loading').length){ var dclFired=false, dclPromise=(function(){ var deferred=$.Deferred(); $(function(){ deferred.resolve(); dclFired=true; }); return deferred.promise(); })(), observer=false, NativeMutationObserver=window.MutationObserver||window.WebkitMutationObserver||window.MozMutationObserver; if(typeof NativeMutationObserver!='undefined'){ observer=new NativeMutationObserver(function(mutationsList, observer){ for(var i in mutationsList){ var mutation=mutationsList[i]; if(mutation.type=='childList'){ $(mutation.target).trigger('skeleton:initialised'); }} }); } var killObserverTrigger=setTimeout(function(){ if(observer){ observer.disconnect(); observer=undefined; }}, 4000); var skeletonTimer; $('.skeleton-loading').each(function(e){ var $this=$(this), skeletonInitialisedPromise=(function(){ var deferred=$.Deferred(); $this.on('skeleton:initialised', function(evt){ if(evt.target.classList.contains('skeleton-loading')){ deferred.resolve(evt); }}); return deferred.promise(); })(), resourcesLoadedPromise=(function(){ return $.Deferred().resolve().promise(); })(); $.when(skeletonInitialisedPromise, resourcesLoadedPromise, dclPromise).done(function(e){ var $real=$(e.target), $placeholder=$real.siblings('.skeleton-body'); if(!$placeholder.length){ $placeholder=$real.parent().parent().parent().find('[class="' + $real.attr('class').replace('skeleton-loading', 'skeleton-body') + '"]'); } porto_init($real); if($real.find('.sidebar-menu:not(.side-menu-accordion)').length){ theme.SidebarMenu.initialize($real.find('.sidebar-menu:not(.side-menu-accordion)')); } if(skeletonTimer){ theme.deleteTimeout(skeletonTimer); } $real.trigger('skeleton-loaded'); theme.requestTimeout(function(){ if($placeholder.length){ if($placeholder.parent().hasClass('yit-wcan-container')){ $placeholder.parent().remove(); }else{ $placeholder.remove(); }} $real.removeClass('skeleton-loading'); if($real.closest('.skeleton-loading-wrap')){ $real.closest('.skeleton-loading-wrap').removeClass('skeleton-loading-wrap'); } if($(document.body).hasClass('elementor-default')||$(document.body).hasClass('elementor-page')){ $(window).trigger('resize'); } theme.refreshStickySidebar(false); }, 100); if(!$('.skeleton-loading').length){ clearTimeout(killObserverTrigger); observer.disconnect(); observer=undefined; }}); if($this.children('script[type="text/template"]').length){ var content=$(JSON.parse($this.children('script[type="text/template"]').eq(0).html())); $this.children('script[type="text/template"]').eq(0).remove(); if(observer){ observer.observe(this, { childList: true, subtree: false }); } $this.append(content); if(!observer){ $this.trigger('skeleton:initialised'); }} }); } $(document).trigger('porto_theme_init'); }); $(window).on('load', function(){ setTimeout(function(){ if(typeof theme.Search!=='undefined'){ theme.Search.initialize(); }}, 0); if(typeof theme.SortFilter!=='undefined'){ theme.SortFilter.initialize(); } $(document).on('click', '.sidebar-toggle', function(e){ e.preventDefault(); var $html=$('html'); if($(this).siblings('.porto-product-filters').length){ if($html.hasClass('filter-sidebar-opened')){ $html.removeClass('filter-sidebar-opened'); $('.sidebar-overlay').removeClass('active'); }else{ $html.removeClass('sidebar-opened'); $html.addClass('filter-sidebar-opened'); $('.sidebar-overlay').addClass('active'); }}else{ if($html.hasClass('sidebar-opened')){ $html.removeClass('sidebar-opened'); $('.sidebar-overlay').removeClass('active'); }else{ $html.addClass('sidebar-opened'); $('.sidebar-overlay').addClass('active'); }} }); $('.minicart-offcanvas .cart-head').on('click', function(){ $(this).closest('.minicart-offcanvas').toggleClass('minicart-opened'); }); $('.minicart-offcanvas .minicart-overlay').on('click', function(){ $(this).closest('.minicart-offcanvas').removeClass('minicart-opened'); }); $(document.body).on('click', '.sidebar-overlay', function(){ $('html').removeClass('sidebar-opened'); $('html').removeClass('filter-sidebar-opened'); $(this).removeClass('active'); }); $(document.body).on('click', '.section-tabs .nav-link', function(e){ e.preventDefault(); var $this=$(this), nav_id=$this.data('tab'), $section_tab=$this.closest('.section-tabs'), $nav_wrap=$section_tab.children('ul.nav'), $tab_content=$section_tab.children('.tab-content'); if(nav_id){ $nav_wrap.find('.active').removeClass('active'); $this.addClass('active').parent('.nav-item').addClass('active'); $tab_content.find('>.active').removeClass('active'); $tab_content.find('>.tab-pane[id="' + nav_id + '"]').addClass('active'); }}); $(window).on('resize', function(e){ if(e.originalEvent&&window.innerWidth > 991&&$('html').hasClass('sidebar-opened')){ $('.sidebar-overlay').trigger('click'); }}); var $matchHeightObj=$('.tabs-simple .featured-box .box-content, .porto-content-box .featured-box .box-content, .vc_general.vc_cta3, .match-height'); if($matchHeightObj.length){ if($.fn.matchHeight){ $matchHeightObj.matchHeight(); }else{ var script=document.createElement("script"); script.addEventListener("load", function(event){ $matchHeightObj.matchHeight(); }); script.src=js_porto_vars.ajax_loader_url.replace('/images/ajax-loader@2x.gif', '/js/libs/jquery.matchHeight.min.js'); script.async=true; document.body.appendChild(script); }} if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ $('.share-whatsapp').css('display', 'inline-block'); } $(document).ajaxComplete(function(event, xhr, options){ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ $('.share-whatsapp').css('display', 'inline-block'); }}); var ua=window.navigator.userAgent, ie12=ua.indexOf('Edge/') > 0; if(ie12) $('html').addClass('ie12'); $(document).on('click', '.portfolios-lightbox a.portfolio-link', function(e){ $(this).find('.thumb-info-zoom').trigger('click'); return false; }); $('.porto-faqs').each(function(){ if($(this).find('.faq .toggle.active').length < 1){ $(this).find('.faq').eq(0).find('.toggle').addClass('active'); $(this).find('.faq').eq(0).find('.toggle-content').show(); }}); $(document).on('shown.bs.collapse', '.collapse', function(){ var panel=$(this); theme.refreshVCContent(panel); }); $(document).on('shown.bs.tab', 'a[data-bs-toggle="tab"]', function(e){ var panel=$($(e.target).attr('href')); theme.refreshVCContent(panel); }); $('.porto-tooltip .tooltip-icon').on('click', function(){ if($(this).parent().children(".tooltip-popup").css("display")=="none"){ $(this).parent().children(".tooltip-popup").fadeIn(200); }else{ $(this).parent().children(".tooltip-popup").fadeOut(200); }}); $('.porto-tooltip .tooltip-close').on('click', function(){ $(this).parent().fadeOut(200); }); }); }).apply(this, [window.theme, jQuery]); (function(theme, $, undefined){ "use strict"; $(document).ready(function(){ $(window).on('vc_reload', function(){ porto_init(); $('.type-post').addClass('post'); $('.type-portfolio').addClass('portfolio'); $('.type-member').addClass('member'); $('.type-block').addClass('block'); }); }); var timelineHeightAdjust={ $timeline: $('#exp-timeline'), $timelineBar: $('#exp-timeline .timeline-bar'), $firstTimelineItem: $('#exp-timeline .timeline-box').first(), $lastTimelineItem: $('#exp-timeline .timeline-box').last(), build: function(){ var self=this; self.adjustHeight(); }, adjustHeight: function(){ var self=this, calcFirstItemHeight=(self.$firstTimelineItem.outerHeight(true) / 2) + 5, calcLastItemHeight=(self.$lastTimelineItem.outerHeight(true) / 2) + 5; self.$timelineBar.css({ top: calcFirstItemHeight, bottom: calcLastItemHeight }); }} if($('#exp-timeline').get(0)){ var timeline_timer=null; $(window).smartresize(function(){ if(timeline_timer){ clearTimeout(timeline_timer); } timeline_timer=setTimeout(function(){ timelineHeightAdjust.build(); }, 800); }); timelineHeightAdjust.build(); } $('.custom-view-our-location').on('click', function(e){ e.preventDefault(); var this_=$(this); $('.custom-googlemap').slideDown('1000', function(){ this_.delay(700).hide(); }); }); })(window.theme, jQuery); (function(theme, $, undefined){ 'use strict'; window.onload=function(){ theme.isLoaded=true; }; $(document).ready(function(){ if(typeof elementorFrontend!='undefined'){ $(window).on('elementor/frontend/init', function(){ elementorFrontend.hooks.addFilter('frontend/handlers/menu_anchor/scroll_top_distance', function(scrollTop){ if(theme&&theme.StickyHeader&&typeof theme.sticky_nav_height!='undefined'){ if(elementorFrontend.elements.$wpAdminBar.length){ scrollTop +=elementorFrontend.elements.$wpAdminBar.height(); } scrollTop=scrollTop - theme.adminBarHeight() - theme.StickyHeader.sticky_height - theme.sticky_nav_height + 1; } return scrollTop; }); }); } if(js_porto_vars.user_edit_pages){ var porto_init_builder_tooltip=function(obj){ var tooltipTriggerList=[].slice.call(obj.querySelectorAll('.pb-edit-link')); tooltipTriggerList.map(function(o){ var title=o.getAttribute('data-title'); if(o.nextSibling&&o.nextSibling.classList.contains('porto-block')){ var tooltipobj=o.nextSibling; tooltipobj.classList.add('has-pb-edit'); var tooltip_ins=new bootstrap.Tooltip(tooltipobj, { html: true, template: '', trigger: 'manual', title: '' + title + '', delay: 300 }); if(tooltip_ins&&tooltip_ins._element){ tooltip_ins._element.addEventListener('mouseenter', function(e){ tooltip_ins._enter(e, tooltip_ins); }); tooltip_ins._element.addEventListener('mouseleave', function(e){ tooltip_ins._leave(e, tooltip_ins); }); }} o.parentNode.removeChild(o); }); }; porto_init_builder_tooltip(document.body); $('.skeleton-loading').on('skeleton-loaded', function(){ porto_init_builder_tooltip(this); }); $(document.body).on('mouseenter mouseleave', '.porto-tooltip-wrap[role="tooltip"]', function(e){ var $element=$('.porto-block[aria-describedby="' + $(this).attr('id') + '"]'); if($element.length){ var ins=bootstrap.Tooltip.getInstance($element.get(0)); if(ins){ var fn_name='mouseenter'==e.type ? '_enter':'_leave'; ins[fn_name](e, ins); }} }).on('porto_init_start', function(e, wrapObj){ if(wrapObj.classList.contains('porto-posts-grid')){ porto_init_builder_tooltip(wrapObj); }}); }}); $('.porto-btn[data-hover]').on('mouseenter', function(){ var hoverColor=$(this).data('hover'), hover_border_color=$(this).data('border-hover'); if(hoverColor){ $(this).data('originalColor', $(this).css('color')); $(this).css('color', hoverColor); } if(hover_border_color){ $(this).data('originalBorderColor', $(this).css('border-color')); $(this).css('border-color', hover_border_color); }}).on('mouseleave', function(){ var originalColor=$(this).data('originalColor'), original_border_color=$(this).data('originalBorderColor'); if(originalColor){ $(this).css('color', originalColor); } if(original_border_color){ $(this).css('border-color', original_border_color); }}); $('#footer .widget_wysija .wysija-submit:not(.btn)').addClass('btn btn-default'); if($('[data-vc-parallax] .owl-carousel').length){ theme.requestTimeout(function(){ if(typeof window.vcParallaxSkroll=='object'){ window.vcParallaxSkroll.refresh(); }}, 200); } if($('.page-content > .alignfull, .post-content > .alignfull').length){ var initAlignFull=function(){ $('.page-content > .alignfull, .post-content > .alignfull').each(function(){ $(this).css('left', -1 * $(this).parent().offset().left).css('right', -1 * $(this).parent().offset().left).css('width', $('body').width() -(parseInt($(this).css('margin-left'), 10) + parseInt($(this).css('margin-right'), 10))); }); }; initAlignFull(); $(window).smartresize(function(){ initAlignFull(); }); }})(window.theme, jQuery); (function(theme, $){ 'use strict'; var $header_main=$('#header .header-main'); var $menu_wrap=$('#header .main-menu-wrap'); if($('.porto-sticky-navbar').length > 0){ window.addEventListener('scroll', function(){ if(window.innerWidth < 576){ var headerOffset=-1; var scrollTop=$(window).scrollTop(); if($header_main.length){ headerOffset=Math.max($header_main.scrollTop() + $header_main.height(), headerOffset); } if($menu_wrap.length){ headerOffset=Math.max($menu_wrap.scrollTop() + $menu_wrap.height(), headerOffset); } if(headerOffset <=0){ if($('#header').length > 0&&$('#header').height() > 10) headerOffset=$('#header').scrollTop() + $('#header').height(); else headerOffset=100; } if(headerOffset <=scrollTop){ $('.porto-sticky-navbar').addClass('fixed'); }else{ $('.porto-sticky-navbar').removeClass('fixed'); }} }, { passive: true }); }})(window.theme, jQuery); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { mfpConfig: { tClose: js_porto_vars.popup_close, tLoading: '
', gallery: { tPrev: js_porto_vars.popup_prev, tNext: js_porto_vars.popup_next, tCounter: js_porto_vars.mfp_counter }, image: { tError: js_porto_vars.mfp_img_error }, ajax: { tError: js_porto_vars.mfp_ajax_error }, callbacks: { open: function(){ $('body').addClass('lightbox-opened'); var fixed=this.st.fixedContentPos; if(fixed){ $('#header.sticky-header .header-main.sticky, #header.sticky-header .main-menu-wrap, .fixed-header #header.sticky-header .header-main, .fixed-header #header.sticky-header .main-menu-wrap').css(theme.rtl_browser ? 'left':'right', theme.getScrollbarWidth()); } var that=$(this._lastFocusedEl); if(( that.closest('.portfolios-lightbox').hasClass('with-thumbs'))&&$(document).width() >=1024){ var portfolio_lightbox_thumbnails_base=that.closest('.portfolios-lightbox.with-thumbs').find('.porto-portfolios-lighbox-thumbnails').clone(), magnificPopup=$.magnificPopup.instance; $('body').prepend(portfolio_lightbox_thumbnails_base); var $portfolios_lightbox_thumbnails=$('body > .porto-portfolios-lighbox-thumbnails'), $portfolios_lightbox_thumbnails_carousel=$portfolios_lightbox_thumbnails.children('.owl-carousel'); $portfolios_lightbox_thumbnails_carousel.themeCarousel($portfolios_lightbox_thumbnails_carousel.data('plugin-options')); $portfolios_lightbox_thumbnails_carousel.trigger('refresh.owl.carousel'); var $carousel_items_wrapper=$portfolios_lightbox_thumbnails_carousel.find('.owl-stage'); $carousel_items_wrapper.find('.owl-item').removeClass('current'); $carousel_items_wrapper.find('.owl-item').eq(magnificPopup.currItem.index).addClass('current'); $.magnificPopup.instance.next=function(){ var magnificPopup=$.magnificPopup.instance; $.magnificPopup.proto.next.call(this); $carousel_items_wrapper.find('.owl-item').removeClass('current'); $carousel_items_wrapper.find('.owl-item').eq(magnificPopup.currItem.index).addClass('current'); }; $.magnificPopup.instance.prev=function(){ var magnificPopup=$.magnificPopup.instance; $.magnificPopup.proto.prev.call(this); $carousel_items_wrapper.find('.owl-item').removeClass('current'); $carousel_items_wrapper.find('.owl-item').eq(magnificPopup.currItem.index).addClass('current'); }; $carousel_items_wrapper.find('.owl-item').on('click', function(){ $carousel_items_wrapper.find('.owl-item').removeClass('current'); $.magnificPopup.instance.goTo($(this).index()); $(this).addClass('current'); }); } }, close: function(){ $('body').removeClass('lightbox-opened'); var fixed=this.st.fixedContentPos; if(fixed){ $('#header.sticky-header .header-main.sticky, #header.sticky-header .main-menu-wrap, .fixed-header #header.sticky-header .header-main, .fixed-header #header.sticky-header .main-menu-wrap').css(theme.rtl_browser ? 'left':'right', ''); } $('.owl-carousel .owl-stage').each(function(){ var $this=$(this), w=$this.width() + parseInt($this.css('padding-left')) + parseInt($this.css('padding-right')); $this.css({ 'width': w + 200 }); setTimeout(function(){ $this.css({ 'width': w }); }, 0); }); var that=$(this._lastFocusedEl); if(( that.parents('.portfolios-lightbox').hasClass('with-thumbs'))&&$(document).width() >=1024){ $(' body > .porto-portfolios-lighbox-thumbnails').remove(); } }} }, }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__animate'; var Animate=function($el, opts){ return this.initialize($el, opts); }; Animate.defaults={ accX: 0, accY: -120, delay: 1, duration: 1000 }; Animate.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, true); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Animate.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.wrapper, delay=0, duration=0; if($el.data('appear-animation-svg')){ $el.find('[data-appear-animation]').each(function(){ var $this=$(this), opts; var pluginOptions=theme.getOptions($this.data('plugin-options')); if(pluginOptions) opts=pluginOptions; $this.themeAnimate(opts); }); return this; } $el.addClass('appear-animation'); var el_obj=$el.get(0); delay=Math.abs($el.data('appear-animation-delay') ? $el.data('appear-animation-delay'):self.options.delay); if(delay > 1){ el_obj.style.animationDelay=delay + 'ms'; } duration=Math.abs($el.data('appear-animation-duration') ? $el.data('appear-animation-duration'):self.options.duration); if(duration!=1000){ el_obj.style.animationDuration=duration + 'ms'; } $el.addClass($el.data('appear-animation') + ' appear-animation-visible'); return this; }}; $.extend(theme, { Animate: Animate }); $.fn.themeAnimate=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this; }else{ return new theme.Animate($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var instanceName='__animatedLetters'; var PluginAnimatedLetters=function($el, opts){ return this.initialize($el, opts); }; PluginAnimatedLetters.defaults={ contentType: 'letter', animationName: 'typeWriter', animationSpeed: 50, startDelay: 500, minWindowWidth: 768, letterClass: '', wordClass: '' }; PluginAnimatedLetters.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } var self=this; this.$el=$el; this.initialText=$el.text(); this.timeoutId=null; this .setData() .setOptions(opts) .build() .events(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginAnimatedLetters.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, letters=self.$el.text().split(''); if($(window).width() < self.options.minWindowWidth){ self.$el.addClass('initialized'); return this; } if(self.options.firstLoadNoAnim){ self.$el.css({ visibility: 'visible' }); if(self.$el.closest('.owl-carousel').get(0)){ setTimeout(function(){ self.$el.closest('.owl-carousel').on('change.owl.carousel', function(){ self.options.firstLoadNoAnim=false; self.build(); }); }, 500); } return this; } self.$el.addClass('initialized'); self.setMinHeight(); if(self.options.contentType=='letter'){ self.$el.text(''); if(self.options.animationName=='typeWriter'){ self.$el.append(''); var index=0; var timeout=function(){ var st=setTimeout(function(){ var letter=letters[index]; self.$el.find('.letters-wrapper').append('' + letter + ''); index++; timeout(); }, self.options.animationSpeed); if(index >=letters.length){ clearTimeout(st); }}; timeout(); }else{ this.timeoutId=setTimeout(function(){ for(var i=0; i < letters.length; i++){ var letter=letters[i]; self.$el.append('' +(letter==' ' ? ' ':letter) + ''); }}, self.options.startDelay); }}else if(self.options.contentType=='word'){ var words=self.$el.text().split(" "), delay=self.options.startDelay; self.$el.empty(); $.each(words, function(i, v){ self.$el.append($('').html('' + v + ' ')); delay=delay + self.options.animationSpeed; }); if($.isFunction($.fn['themeAnimate'])&&self.$el.find('.animated-words-item[data-appear-animation]').length){ self.$el.find('[data-appear-animation]').each(function(){ var $this=$(this), opts; var pluginOptions=theme.getOptions($this.data('plugin-options')); if(pluginOptions) opts=pluginOptions; $this.themeAnimate(opts); }); } self.$el.addClass('initialized'); } return this; }, setMinHeight: function(){ var self=this; if(self.$el.closest('.owl-carousel').get(0)){ self.$el.closest('.owl-carousel').addClass('d-block'); self.$el.css('min-height', self.$el.height()); self.$el.closest('.owl-carousel').removeClass('d-block'); }else{ self.$el.css('min-height', self.$el.height()); } return this; }, destroy: function(){ var self=this; self.$el .html(self.initialText) .css('min-height', ''); if(this.timeoutId){ clearTimeout(this.timeoutId); this.timeoutId=null; } return this; }, events: function(){ var self=this; self.$el.on('animated.letters.destroy', function(){ self.destroy(); }); self.$el.on('animated.letters.initialize', function(){ self.build(); }); return this; }}; $.extend(theme, { PluginAnimatedLetters: PluginAnimatedLetters }); $.fn.themePluginAnimatedLetters=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginAnimatedLetters($this, opts); }}); }}).apply(this, [window.theme, jQuery]); if(typeof jQuery.fn.owlCarousel=='function'){ (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__carousel'; var Carousel=function($el, opts){ return this.initialize($el, opts); }; Carousel.defaults=$.extend({}, { loop: true, navText: [], themeConfig: false, lazyLoad: true, lg: 0, md: 0, sm: 0, xs: 0, single: false, rtl: theme.rtl }); Carousel.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, true); return this; }, setOptions: function(opts){ if(( opts&&opts.themeConfig)||!opts){ this.options=$.extend(true, {}, Carousel.defaults, theme.owlConfig, opts, { wrapper: this.$el, themeConfig: true }); }else{ this.options=$.extend(true, {}, Carousel.defaults, opts, { wrapper: this.$el }); } return this; }, calcOwlHeight: function($el){ var h=0; $el.find('.owl-item.active').each(function(){ if(h < $(this).height()) h=$(this).height(); }); $el.children('.owl-stage-outer').height(h); }, build: function(){ if(!$.fn.owlCarousel){ return this; } var $el=this.options.wrapper, loop=this.options.loop, lg=this.options.lg, md=this.options.md, sm=this.options.sm, xs=this.options.xs, single=this.options.single, zoom=$el.find('.zoom').filter(function(){ if($(this).closest('.tb-image-type-slider').length){ return false; } return true; }).get(0), responsive={}, items, count=$el.find('.owl-item').length > 0 ? $el.find('.owl-item:not(.cloned)').length:$el.find('> *').length, fullscreen=typeof this.options.fullscreen=='undefined' ? false:this.options.fullscreen; /*if(fullscreen){ $el.children().width(window.innerWidth - theme.getScrollbarWidth()); $el.children().height($el.closest('.fullscreen-carousel').length ? $el.closest('.fullscreen-carousel').height():window.innerHeight); $el.children().css('max-height', '100%'); $(window).on('resize', function(){ $el.find('.owl-item').children().width(window.innerWidth - theme.getScrollbarWidth()); $el.find('.owl-item').children().height($el.closest('.fullscreen-carousel').length ? $el.closest('.fullscreen-carousel').height():window.innerHeight); $el.find('.owl-item').children().css('max-height', '100%'); }); }*/ if(single){ items=1; }else if(typeof this.options.responsive!='undefined'){ for(var w in this.options.responsive){ var number_items=Number(this.options.responsive[w]); responsive[Number(w)]={ items: number_items, loop:(loop&&count >=number_items) ? true:false };}}else{ items=this.options.items ? this.options.items:(lg ? lg:1); var isResponsive=(this.options.xl||lg||md||sm||xs); if(isResponsive){ if(this.options.xl){ responsive[1400]={ items: this.options.xl, loop:(loop&&count > this.options.xl) ? true:false, mergeFit: this.options.mergeFit };}else{ if(lg&&items > lg + 1){ responsive[1400]={ items: items, loop:(loop&&count > items) ? true:false, mergeFit: this.options.mergeFit }; if(theme.screen_lg < 1400){ responsive[theme.screen_lg]={ items: lg + 1, loop:(loop&&count > lg + 1) ? true:false, mergeFit: this.options.mergeFit };}} } if(typeof responsive[1400]=='undefined'&&typeof responsive[theme.screen_lg]=='undefined'){ responsive[theme.screen_lg]={ items: items, loop:(loop&&count >=items) ? true:false, mergeFit: this.options.mergeFit };} if(lg) responsive[992]={ items: lg, loop:(loop&&count >=lg) ? true:false, mergeFit: this.options.mergeFit_lg }; if(md) responsive[768]={ items: md, loop:(loop&&count > md) ? true:false, mergeFit: this.options.mergeFit_md }; if(sm){ responsive[576]={ items: sm, loop:(loop&&count > sm) ? true:false, mergeFit: this.options.mergeFit_sm };}else{ responsive[576]={ items: 1, mergeFit: false };} if(xs){ responsive[0]={ items: xs, loop:(loop&&count > xs) ? true:false, mergeFit: this.options.mergeFit_xs };}else{ responsive[0]={ items: 1 };}} } if(!$el.hasClass('show-nav-title')&&this.options.themeConfig&&theme.slider_nav&&theme.slider_nav_hover){ $el.addClass('show-nav-hover'); } this.options=$.extend(true, {}, this.options, { items: items, loop:(loop&&count > items) ? true:false, responsive: responsive, onInitialized: function(){ if($el.hasClass('stage-margin')){ $el.find('.owl-stage-outer').css({ 'margin-left': this.options.stagePadding, 'margin-right': this.options.stagePadding }); } var heading_cls='.porto-u-heading, .vc_custom_heading, .slider-title, .elementor-widget-heading, .porto-heading'; if($el.hasClass('show-dots-title')&&($el.prev(heading_cls).length||$el.closest('.slider-wrapper').prev(heading_cls).length||$el.closest('.porto-recent-posts').prev(heading_cls).length||$el.closest('.elementor-widget-porto_recent_posts, .elementor-section').prev(heading_cls).length)){ var $obj=$el.prev(heading_cls); if(!$obj.length){ $obj=$el.closest('.slider-wrapper').prev(heading_cls); } if(!$obj.length){ $obj=$el.closest('.porto-recent-posts').prev(heading_cls); } if(!$obj.length){ $obj=$el.closest('.elementor-widget-porto_recent_posts, .elementor-section').prev(heading_cls); } try { var innerWidth=$obj.addClass('w-auto').css('display', 'inline-block').width(); $obj.removeClass('w-auto').css('display', ''); if(innerWidth + 15 + $el.find('.owl-dots').width() <=$obj.width()){ $el.find('.owl-dots').css('left', innerWidth + 15 +($el.width() - $obj.width()) / 2); $el.find('.owl-dots').css('top', -1 * $obj.height() / 2 - parseInt($obj.css('margin-bottom')) - $el.find('.owl-dots').height() / 2 + 2); }else{ $el.find('.owl-dots').css('position', 'static'); }} catch(e){ }} }}); if(this.options.autoHeight){ var thisobj=this; $(window).on('resize', function(){ thisobj.calcOwlHeight($el); }); if(theme.isLoaded){ setTimeout(function(){ thisobj.calcOwlHeight($el); }, 100); }else{ $(window).on('load', function(){ thisobj.calcOwlHeight($el); }); }} var links=false; if(zoom){ links=[]; var i=0; $el.find('.zoom').each(function(){ var slide={}, $zoom=$(this); slide.src=$zoom.data('src') ? $zoom.data('src'):$zoom.data('mfp-src'); slide.title=$zoom.data('title'); links[i]=slide; $zoom.data('index', i); i++; }); } if($el.hasClass('show-nav-title')){ this.options.stagePadding=0; }else{ if(this.options.themeConfig&&theme.slider_nav&&theme.slider_nav_hover) $el.addClass('show-nav-hover'); if(this.options.themeConfig&&!theme.slider_nav_hover&&theme.slider_margin) $el.addClass('stage-margin'); } if($el.hasClass('has-ccols-spacing')){ $el.removeClass('has-ccols-spacing'); } $el.owlCarousel(this.options); if(zoom&&links){ $el.on('click', '.zoom', function(e){ e.preventDefault(); if($.fn.magnificPopup){ var image_index=$(this).data('index'); if(typeof image_index=='undefined'){ image_index=($(this).closest('.owl-item').index() - $el.find('.cloned').length / 2) % $el.data('owl.carousel').items().length; } $.magnificPopup.close(); $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { items: links, gallery: { enabled: true }, type: 'image' }), image_index); } return false; }); } return this; }} $.extend(theme, { Carousel: Carousel }); $.fn.themeCarousel=function(opts, zoom){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this; }else{ return new theme.Carousel($this, opts, zoom); }}); }}).apply(this, [window.theme, jQuery]); } (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__lightbox'; var Lightbox=function($el, opts){ return this.initialize($el, opts); }; Lightbox.defaults={ callbacks: { open: function(){ $('body').addClass('lightbox-opened'); }, close: function(){ $('body').removeClass('lightbox-opened'); }} }; Lightbox.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Lightbox.defaults, theme.mfpConfig, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!$.fn.magnificPopup){ return this; } this.options.wrapper.magnificPopup(this.options); return this; }}; $.extend(theme, { Lightbox: Lightbox }); $.fn.themeLightbox=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Lightbox($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__toggle'; var VcImageZoom=function($el, opts){ return this.initialize($el, opts); }; VcImageZoom.defaults={ }; VcImageZoom.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, VcImageZoom.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.container; $el.parent().magnificPopup($.extend(true, {}, theme.mfpConfig, { delegate: ".porto-vc-zoom", gallery: { enabled: true }, mainClass: 'mfp-with-zoom', zoom: { enabled: true, duration: 300 }, type: 'image' })); return this; }}; $.extend(theme, { VcImageZoom: VcImageZoom }); $.fn.themeVcImageZoom=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.VcImageZoom($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var $rev_sliders; $.extend(theme, { PostAjaxModal: { defaults: { elements: '.page-portfolios' }, initialize: function($elements, post_type){ this.$elements=($elements||$(this.defaults.elements)); if(typeof post_type=='undefined'){ post_type='portfolio'; } this.build(post_type); return this; }, build: function(post_type){ var parentobj=this, postAjaxOnModal={ $wrapper: null, modals: [], currentModal: 0, total: 0, p_type: 'portfolio', build: function($this, p_type){ var self=this; self.$wrapper=$this; if(!self.$wrapper){ return; } self.modals=[]; self.total=0; self.p_type=p_type; $this.find('a[data-ajax-on-modal]').each(function(){ self.add($(this)); }); $this.off('mousedown', 'a[data-ajax-on-modal]').on('mousedown', 'a[data-ajax-on-modal]', function(ev){ if(ev.which==2){ ev.preventDefault(); return false; }}); }, add: function($el){ var self=this, href=$el.attr('href'), index=self.total; self.modals.push({ src: href }); self.total++; $el.off('click').on('click', function(e){ e.preventDefault(); self.show(index); return false; }); }, next: function(){ var self=this; if(self.currentModal + 1 < self.total){ self.show(self.currentModal + 1); }else{ self.show(0); }}, prev: function(){ var self=this; if(( self.currentModal - 1) >=0){ self.show(self.currentModal - 1); }else{ self.show(self.total - 1); }}, show: function(i){ var self=this; self.currentModal=i; if(i < 0||i >(self.total - 1)){ return false; } $.magnificPopup.close(); $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { type: 'ajax', items: self.modals, gallery: { enabled: true }, ajax: { settings: { type: 'post', data: { ajax_action: self.p_type + '_ajax_modal' }} }, mainClass: self.p_type + '-ajax-modal', fixedContentPos: false, callbacks: { parseAjax: function(mfpResponse){ var $response=$(mfpResponse.data), $post=$response.find('#content article.' + self.p_type), $vc_css=$response.filter('style[data-type]:not("")'), vc_css=''; $vc_css.each(function(){ vc_css +=$(this).text(); }); if($('#' + self.p_type + 'AjaxCSS').get(0)){ $('#' + self.p_type + 'AjaxCSS').text(vc_css); }else{ $('').appendTo("head") } $post.find('.' + self.p_type + '-nav-all').html(''); $post.find('.' + self.p_type + '-nav').html(''); $post.find('.elementor-invisible').removeClass('elementor-invisible'); mfpResponse.data='
' + $post.html() + '
'; }, ajaxContentAdded: function(){ var $wrapper=$('.' + self.p_type + '-ajax-modal'); $wrapper.find('a[data-ajax-' + self.p_type + '-close]').on('click', function(e){ e.preventDefault(); $.magnificPopup.close(); return false; }); $rev_sliders=$wrapper.find('.rev_slider, rs-module'); if(self.modals.length <=1){ $wrapper.find('a[data-ajax-' + self.p_type + '-prev], a[data-ajax-' + self.p_type + '-next]').remove(); }else{ $wrapper.find('a[data-ajax-' + self.p_type + '-prev]').on('click', function(e){ e.preventDefault(); if($rev_sliders&&$rev_sliders.get(0)){ try { $rev_sliders.revkill(); } catch(err){ }} $wrapper.find('.mfp-arrow-left').trigger('click'); return false; }); $wrapper.find('a[data-ajax-' + self.p_type + '-next]').on('click', function(e){ e.preventDefault(); if($rev_sliders&&$rev_sliders.get(0)){ try { $rev_sliders.revkill(); } catch(err){ }} $wrapper.find('.mfp-arrow-right').trigger('click'); return false; }); } if('portfolio'==self.p_type){ $(window).trigger('resize'); } porto_init(); theme.refreshVCContent($wrapper); setTimeout(function(){ var videos=$wrapper.find('video'); if(videos.get(0)){ videos.each(function(){ $(this)[0].play(); $(this).parent().parent().parent().find('.video-controls').attr('data-action', 'play'); $(this).parent().parent().parent().find('.video-controls').html(''); }); }}, 600); $wrapper.off('scroll').on('scroll', function(){ $.fn.appear.run(); }); }, change: function(){ $('.mfp-wrap .ajax-container').trigger('click'); }, beforeClose: function(){ if($rev_sliders&&$rev_sliders.get(0)){ try { $rev_sliders.revkill(); } catch(err){ }} var $wrapper=$('.' + self.p_type + '-ajax-modal'); $wrapper.off('scroll'); }} }), i); }}; parentobj.$elements.each(function(){ var $this=$(this); if(!$this.find('a[data-ajax-on-modal]').get(0)){ return; } if($this.data(post_type + 'AjaxOnModal')){ return; } postAjaxOnModal.build($this, post_type); $this.data(post_type + 'AjaxOnModal', postAjaxOnModal); }); return parentobj; }} }); $(document.documentElement).on('keydown', function(e){ try { if(e.keyCode==37||e.keyCode==39){ if($rev_sliders&&$rev_sliders.get(0)){ $rev_sliders.revkill(); }} } catch(err){ }}); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var activePortfolioAjaxOnPage; $.extend(theme, { PortfolioAjaxPage: { defaults: { elements: '.page-portfolios' }, initialize: function($elements){ this.$elements=($elements||$(this.defaults.elements)); this.build(); return this; }, build: function(){ var self=this; self.$elements.each(function(){ var $this=$(this); if(!$this.find('#portfolioAjaxBox').get(0)){ return; } if($this.data('portfolioAjaxOnPage')){ return; } var $container=$(this), portfolioAjaxOnPage={ $wrapper: $container, pages: [], currentPage: 0, total: 0, $ajaxBox: $this.find('#portfolioAjaxBox'), $ajaxBoxContent: $this.find('#portfolioAjaxBoxContent'), build: function(){ var self=this; self.pages=[]; self.total=0; $this.find('a[data-ajax-on-page]').each(function(){ self.add($(this)); }); $this.off('mousedown', 'a[data-ajax-on-page]').on('mousedown', 'a[data-ajax-on-page]', function(ev){ if(ev.which==2){ ev.preventDefault(); return false; }}); }, add: function($el){ var self=this, href=$el.attr('href'); self.pages.push(href); self.total++; $el.off('click').on('click', function(e){ e.preventDefault(); var _class=e.target.className if(_class=='owl-next'){ return false; }else if(_class=='owl-prev'){ return false; }else{ self.show(self.pages.indexOf(href)); } return false; }); }, events: function(){ var self=this; $this.off('click', 'a[data-ajax-portfolio-close]').on('click', 'a[data-ajax-portfolio-close]', function(e){ e.preventDefault(); self.close(); return false; }); if(self.total <=1){ $('a[data-ajax-portfolio-prev], a[data-ajax-portfolio-next]').remove(); }else{ $this.off('click', 'a[data-ajax-portfolio-prev]').on('click', 'a[data-ajax-portfolio-prev]', function(e){ e.preventDefault(); self.prev(); return false; }); $this.off('click', 'a[data-ajax-portfolio-next]').on('click', 'a[data-ajax-portfolio-next]', function(e){ e.preventDefault(); self.next(); return false; }); }}, close: function(){ var self=this; if(self.$ajaxBoxContent.find('.rev_slider, rs-module').get(0)){ try { self.$ajaxBoxContent.find('.rev_slider, rs-module').revkill(); } catch(err){ }} self.$ajaxBoxContent.empty(); self.$ajaxBox.removeClass('ajax-box-init').removeClass('ajax-box-loading'); }, next: function(){ var self=this; if(self.currentPage + 1 < self.total){ self.show(self.currentPage + 1); }else{ self.show(0); }}, prev: function(){ var self=this; if(( self.currentPage - 1) >=0){ self.show(self.currentPage - 1); }else{ self.show(self.total - 1); }}, show: function(i){ var self=this; activePortfolioAjaxOnPage=null; if(self.$ajaxBoxContent.find('.rev_slider, rs-module').get(0)){ try { self.$ajaxBoxContent.find('.rev_slider, rs-module').revkill(); } catch(err){ }} self.$ajaxBoxContent.empty(); self.$ajaxBox.removeClass('ajax-box-init').addClass('ajax-box-loading'); theme.scrolltoContainer(self.$ajaxBox); self.currentPage=i; if(i < 0||i >(self.total - 1)){ self.close(); return false; } $.ajax({ url: self.pages[i], complete: function(data){ var $response=$(data.responseText), $portfolio=$response.find('#content article.portfolio'), $vc_css=$response.filter('style[data-type]:not("")'), vc_css=''; if($('#portfolioAjaxCSS').get(0)){ $('#portfolioAjaxCSS').text(vc_css); }else{ $('').appendTo("head") } $portfolio.find('.portfolio-nav-all').html(''); $portfolio.find('.portfolio-nav').html(''); self.$ajaxBoxContent.html($portfolio.html()).append('

'); self.$ajaxBox.removeClass('ajax-box-loading'); $(window).trigger('resize'); porto_init(); theme.refreshVCContent(self.$ajaxBoxContent); self.events(); activePortfolioAjaxOnPage=self; self.$ajaxBoxContent.find('.lightbox:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeLightbox(opts); }); }}); }}; portfolioAjaxOnPage.build(); $this.data('portfolioAjaxOnPage', portfolioAjaxOnPage); }); return self; }} }); $(document.documentElement).on('keyup', function(e){ try { if(!activePortfolioAjaxOnPage) return; if(e.keyCode==39){ activePortfolioAjaxOnPage.next(); } if(e.keyCode==37){ activePortfolioAjaxOnPage.prev(); }} catch(err){ }}); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { PostFilter: { cache: { }, defaults: { elements: '.portfolio-filter' }, initialize: function($elements, post_type){ this.$elements=($elements||$(this.defaults.elements)); this.build(post_type); return this; }, filterFn: function(e){ if(typeof e=='undefined'||typeof e.data=='undefined'||typeof e.data.elements=='undefined'||!e.data.elements||!e.data.elements.length){ return; } var self=e.data.selfobj; if(self.isLoading){ return false; } var $this=e.data.thisobj, $elements=e.data.elements, position=e.data.position, post_type=e.data.post_type, $parent=e.data.parent, $posts_wrap=e.data.posts_wrap, use_ajax=e.data.use_ajax, page_path=e.data.page_path, infinite_load=e.data.infinite_load, load_more=e.data.load_more; e.preventDefault(); if($(this).hasClass('active')){ return; } self.isLoading=true; var selector=$(this).attr('data-filter'); if('sidebar'==position){ $('.sidebar-overlay').trigger('click'); } $this.find('.active').removeClass('active'); if(use_ajax){ var current_cat='*'==selector ? '':selector; if(!page_path){ page_path=$posts_wrap.data('page_path'); } if(page_path){ $posts_wrap.data('page_path', page_path.replace(/&category=[^&]*&/, '&category=' + current_cat + '&')); } $(this).addClass('active'); self.load_posts(current_cat, infinite_load||load_more ? true:false, $parent, post_type, $posts_wrap, undefined, $(this).children('a').attr('href')); }else if('faq'==post_type){ $parent.find('.faq').each(function(){ var $that=$(this), easing="easeInOutQuart", timeout=300; if(selector=='*'){ if($that.css('display')=='none') $that.stop(true).slideDown(timeout, easing, function(){ $(this).attr('style', '').show(); }); selected++; }else{ if($that.hasClass(selector)){ if($that.css('display')=='none') $that.stop(true).slideDown(timeout, easing, function(){ $(this).attr('style', '').show(); }); selected++; }else{ if($that.css('display')!='none') $that.stop(true).slideUp(timeout, easing, function(){ $(this).attr('style', '').hide(); }); }} }); if(!selected&&$parent.find('.faqs-infinite').length&&typeof($.fn.infinitescroll)!='undefined'){ $parent.find('.faqs-infinite').infinitescroll('retrieve'); }}else if($parent.hasClass('portfolios-timeline')){ var selected=0; $parent.find('.portfolio').each(function(){ var $that=$(this), easing="easeInOutQuart", timeout=300; if(selector=='*'){ if($that.css('display')=='none') $that.stop(true).slideDown(timeout, easing, function(){ $(this).attr('style', '').show(); }); selected++; }else{ if($that.hasClass(selector)){ if($that.css('display')=='none') $that.stop(true).slideDown(timeout, easing, function(){ $(this).attr('style', '').show(); }); selected++; }else{ if($that.css('display')!='none') $that.stop(true).slideUp(timeout, easing, function(){ $(this).attr('style', '').hide(); }); }} }); if(!selected&&$parent.find('.portfolios-infinite').length&&typeof($.fn.infinitescroll)!='undefined'){ $parent.find('.portfolios-infinite').infinitescroll('retrieve'); } setTimeout(function(){ theme.FilterZoom.initialize($parent); }, 400); }else{ $parent.find('.' + post_type + '-row').isotope({ filter: selector=='*' ? selector:'.' + selector }); } if(!use_ajax){ $(this).addClass('active'); self.isLoading=false; } if(position=='sidebar'){ self.$elements.each(function(){ var $that=$(this); if($that==$this&&$that.data('position')!='sidebar') return; $that.find('li').removeClass('active'); $that.find('li[data-filter="' + selector + '"]').addClass('active'); }); } if(!use_ajax){ window.location.hash='#' + selector; } theme.refreshVCContent(); return false; }, build: function(post_type_param){ var self=this; self.$elements.each(function(){ var $this=$(this), position=$this.data('position'), $parent, post_type; if(typeof post_type_param=='undefined'){ if($this.hasClass('member-filter')){ post_type='member'; }else if($this.hasClass('faq-filter')){ post_type='faq'; }else if($this.hasClass('product-filter')){ post_type='product'; }else if($this.hasClass('post-filter')){ post_type='post'; }else if($this.hasClass('portfolio-filter')){ post_type='portfolio'; }else{ post_type=$this.attr('data-filter-type'); }}else{ post_type=post_type_param; } if('sidebar'==position){ $parent=$('.main-content .page-' + post_type + 's'); }else if('global'==position){ $parent=$('.main-content .page-' + post_type + 's'); }else{ $parent=$this.closest('.page-' + post_type + 's'); } if(!$parent.length){ $parent=$this.closest('.porto-posts-grid'); } if(!$parent||!$parent.length){ return; } var use_ajax=$this.hasClass('porto-ajax-filter'), infinite_load=$parent.hasClass('load-infinite'), load_more=$parent.hasClass('load-more'); var $posts_wrap=$parent.find('.' + post_type + 's-container'), page_path; if(use_ajax&&(( !infinite_load&&!load_more)||!$parent.data('ajax_load_options'))){ var current_url=window.location.href; if(-1!==current_url.indexOf('#')){ current_url=current_url.split('#')[0]; } page_path=theme.ajax_url + '?action=porto_ajax_posts&nonce=' + js_porto_vars.porto_nonce + '&post_type=' + post_type + '¤t_link=' + current_url + '&category=&page=%cur_page%'; if($parent.data('post_layout')){ page_path +='&post_layout=' + $parent.data('post_layout'); } $posts_wrap.data('page_path', page_path); } $this.find('li').on('click', { thisobj: $this, selfobj: self, elements: self.$elements, position: position, parent: $parent, post_type: post_type, posts_wrap: $posts_wrap, use_ajax: use_ajax, page_path: page_path, infinite_load: infinite_load, load_more: load_more }, self.filterFn); }); $(window).on('hashchange', { elements: self.$elements }, self.hashchange); self.hashchange({ data: { elements: self.$elements }}); return self; }, hashchange: function(e){ if(typeof e=='undefined'||typeof e.data=='undefined'||typeof e.data.elements=='undefined'||!e.data.elements||!e.data.elements.length){ return; } var $elements=e.data.elements, $filter=$($elements.get(0)), hash=window.location.hash; if(hash){ var $o=$filter.find('li[data-filter="' + hash.replace('#', '') + '"]'); if(!$o.hasClass('active')){ $o.trigger('click'); }} }, set_elements: function($elements){ var self=this; if(typeof $elements=='undefined'||!$elements||!$elements.length){ self.destroy(self.$elements); return; } self.$elements=$elements; $(window).off('hashchange', self.hashchange).on('hashchange', { elements: $elements }, self.hashchange); }, destroy: function($elements){ if(typeof $elements=='undefined'||!$elements||!$elements.length){ return; } var self=this; $elements.find('li').off('click', self.filterFn); $(window).off('hashchange', self.hashchange); }, load_posts: function(cat, is_infinite, $parent, post_type, $posts_wrap, default_args, page_url){ var pid=$parent.attr('id'), self=this, is_archive=$parent.hasClass('archive-posts'), successfn=function(res, directcall){ if(!res){ return; } if(( typeof directcall=='undefined'||true!==directcall)&&typeof default_args=='undefined'&&pid){ if(!self.cache[pid]){ self.cache[pid]={};} self.cache[pid][cat]=res; } var $res=$(res), is_shop=$parent.hasClass('archive-products'), $posts=$res.find(is_archive ? '.archive-posts .posts-wrap':'.posts-wrap').children(); if(!$posts.length){ return; } if(typeof $posts_wrap=='undefined'||is_archive){ $posts_wrap=$parent.find('.' + post_type + 's-container'); } if(!$posts_wrap.length){ return; } if($posts_wrap.data('isotope')){ $posts_wrap.isotope('remove', $posts_wrap.children()); }else{ $posts_wrap.children().remove(); } if($posts_wrap.hasClass('owl-loaded')){ $posts_wrap.removeClass('owl-loaded'); } $posts_wrap.append($posts); theme.refreshVCContent($posts); var $old_filter=$parent.find('.' + post_type + '-filter'); if($old_filter.length&&!$old_filter.hasClass('porto-ajax-filter')&&!$parent.hasClass('load-infinite')&&!$parent.hasClass('load-more')){ var $new_filter=$res.find(( is_archive ? '.archive-posts ':'') + '.' + post_type + '-filter'); if($new_filter.length){ $old_filter.find('li:first-child').trigger('click'); theme.PostFilter.destroy($old_filter); $old_filter.replaceWith($new_filter); theme.PostFilter.initialize($new_filter, post_type); theme.PostFilter.set_elements($('ul[data-filter-type]')); }} porto_init($parent); var behavior_action=''; if(post_type!='product'&&post_type!='member'&&post_type!='faq'&&post_type!='portfolio'&&post_type!='post'){ behavior_action='ptu'; }else{ behavior_action=post_type; } theme.PostsInfinite[behavior_action + 'Behavior']($posts, $posts_wrap); $(document.body).trigger('porto_init_countdown', [$posts_wrap]); var $old_pagination=$parent.find('.pagination-wrap'), $new_pagination=$res.find(( is_archive ? '.archive-posts ':'') + '.pagination-wrap').eq(0), has_pagination=false; if($old_pagination.length){ if($new_pagination.length){ $old_pagination.replaceWith($new_pagination); has_pagination=true; }else{ $old_pagination.children().remove(); }}else if($new_pagination.length){ $parent.append($new_pagination); has_pagination=true; } if(is_infinite){ var infinitescroll_ins=$posts_wrap.data('infinitescroll'); if(has_pagination){ var $new_posts_wrap=$res.find(is_archive ? '.archive-posts .posts-wrap':'.posts-wrap'); if($new_posts_wrap.data('cur_page')){ $posts_wrap.data('cur_page', $new_posts_wrap.data('cur_page')); $posts_wrap.data('max_page', $new_posts_wrap.data('max_page')); } var should_init_again=true; if(infinitescroll_ins){ if(infinitescroll_ins.options.state.isDestroyed){ $posts_wrap.removeData('infinitescroll'); }else{ should_init_again=false; if($new_posts_wrap.data('cur_page')){ infinitescroll_ins.update({ maxPage: $new_posts_wrap.data('max_page'), state: { currPage: $new_posts_wrap.data('cur_page') }}); } if(infinitescroll_ins.options.state.isPaused){ infinitescroll_ins.resume(); }} } if(should_init_again){ var ins=$posts_wrap.data('__postsinfinite'); if(ins){ ins.destroy(); } new theme.PostsInfinite($posts_wrap, '.' + post_type + ', .timeline-date', $posts_wrap.data('infiniteoptions'), post_type); } if(is_archive){ var page_path=$posts_wrap.siblings('.pagination-wrap').find('.next').attr('href'); if(page_path){ page_path +=(-1!==page_path.indexOf('?') ? '&':'?') + 'portoajax=1&load_posts_only=2'; page_path=page_path.replace(/(paged=)(\d+)|(page\/)(\d+)/, '$1$3%cur_page%'); $posts_wrap.data('page_path', page_path); }} new theme.PostsInfinite($posts_wrap, '.' + post_type + ', .timeline-date', $posts_wrap.data('infiniteoptions'), post_type); }} if(is_archive){ $('.sidebar-content').each(function(index){ var $this=$(this), $that=$($res.find('.sidebar-content').get(index)); $this.html($that.html()); if(is_shop){ if(typeof updateSelect2!='undefined'&&updateSelect2){ if(jQuery().selectWoo){ var porto_wc_layered_nav_select=function(){ $this.find('select.woocommerce-widget-layered-nav-dropdown').each(function(){ $(this).selectWoo({ placeholder: $(this).find('option').eq(0).text(), minimumResultsForSearch: 5, width: '100%', allowClear: typeof $(this).attr('multiple')!='undefined'&&$(this).attr('multiple')=='multiple' ? 'false':'true' }); }); }; porto_wc_layered_nav_select(); } $('body').children('span.select2-container').remove(); }} }); if(is_shop){ var $script=$res.filter('script:contains("var woocommerce_price_slider_params")').first(); if($script&&$script.length&&$script.text().indexOf('{')!==-1&&$script.text().indexOf('}')!==-1){ var arrStr=$script.text().substring($script.text().indexOf('{'), $script.text().indexOf('}') + 1); window.woocommerce_price_slider_params=JSON.parse(arrStr); } var $title=$('.entry-title'); if($title.length){ var $newTitle=$res.find('.entry-title').eq(0); if($newTitle.length){ $title.html($newTitle.html()); }} var $desc=$('.entry-description'); if($desc.length){ var $newDesc=$res.find('.entry-description').eq(0); if($newDesc.length){ $desc.html($newDesc.html()); }} var shop_before='.shop-loop-before', $shop_before=$(shop_before); if($shop_before.length){ if($res.find(shop_before).length){ $shop_before.each(function(index){ var $res_shop_before=$res.find(shop_before).eq(index); if($res_shop_before.length){ $(this).html($res_shop_before.html()).show(); }}); }else{ $shop_before.empty(); }} var $count=$('.woocommerce-result-count'); if($count.length){ var $newCount=$res.find('.woocommerce-result-count').eq(0); if($newCount.length){ $count[0].outerHTML=$newCount.length ? $newCount[0].outerHTML:''; }} $(document).trigger('yith-wcan-ajax-filtered'); } if(page_url&&!navigator.userAgent.match(/msie/i)){ window.history.pushState({ 'pageTitle':(res&&res.pageTitle)||'' }, '', page_url); }} $(document.body).trigger('porto_load_posts_end', [$parent.parent()]); }; if(typeof default_args=='undefined'&&typeof self.cache[pid]!='undefined'&&typeof self.cache[pid][cat]!='undefined'&&self.cache[pid][cat]){ successfn(self.cache[pid][cat], true); self.isLoading=false; $parent.removeClass('porto-ajax-loading').removeClass('loading').find('.porto-loading-icon').remove(); return; } var ajax_load_options=$parent.data('ajax_load_options'); if(( $parent.hasClass('archive-products')&&-1!=js_porto_vars.use_skeleton_screen.indexOf('shop')) || (is_archive&&-1!=js_porto_vars.use_skeleton_screen.indexOf('blog'))){ $posts_wrap=$parent.find('.' + post_type + 's-container'); if(ajax_load_options){ var tag_name='div'; if('product'==post_type&&'ul'==$posts_wrap.get(0).tagName.toLowerCase()){ tag_name='li'; } $posts_wrap.addClass('skeleton-body').empty(); for(var i=0; i < Number(ajax_load_options.count||(ajax_load_options.columns&&ajax_load_options.columns * 3)||12); i++){ $posts_wrap.append('<' + tag_name + ' class="porto-tb-item post ' + post_type +('product'==post_type ? ' product-col':'') + '">'); }}else{ $posts_wrap.addClass('skeleton-body').children().empty(); }}else{ if(!$parent.children('.porto-loading-icon').length){ $parent.append(''); } $parent.addClass('porto-ajax-loading'); } var current_url=window.location.href; if(-1!==current_url.indexOf('#')){ current_url=current_url.split('#')[0]; } var args, load_url=theme.ajax_url; if($parent.hasClass('archive-posts')){ args={ portoajax: true, load_posts_only: true }; if($parent.closest('.porto-block').length){ args['builder_id']=$parent.closest('.porto-block').data('id'); } load_url=typeof page_url!='undefined' ? page_url:current_url; }else{ args={ action: 'porto_ajax_posts', nonce: js_porto_vars.porto_nonce, post_type: post_type, current_link: current_url }; if($parent.data('post_layout')){ args['post_layout']=$parent.data('post_layout'); } if(ajax_load_options){ args['extra']=ajax_load_options; } if(typeof default_args!='undefined'){ args=$.extend(args, default_args); }} if(cat){ args['category']=cat; } $.ajax({ url: load_url, type: 'post', data: args, success: successfn, complete: function(){ self.isLoading=false; $posts_wrap.removeClass('skeleton-body'); $parent.removeClass('porto-ajax-loading').removeClass('loading').find('.porto-loading-icon').remove(); }}); }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var activeMemberAjaxOnPage; $.extend(theme, { MemberAjaxPage: { defaults: { elements: '.page-members' }, initialize: function($elements){ this.$elements=($elements||$(this.defaults.elements)); this.build(); return this; }, build: function(){ var self=this; self.$elements.each(function(){ var $this=$(this); if(!$this.find('#memberAjaxBox').get(0)) return; var $container=$(this), memberAjaxOnPage={ $wrapper: $container, pages: [], currentPage: 0, total: 0, $ajaxBox: $this.find('#memberAjaxBox'), $ajaxBoxContent: $this.find('#memberAjaxBoxContent'), build: function(){ var self=this; self.pages=[]; self.total=0; $this.find('a[data-ajax-on-page]').each(function(){ self.add($(this)); }); $this.off('mousedown', 'a[data-ajax-on-page]').on('mousedown', 'a[data-ajax-on-page]', function(ev){ if(ev.which==2){ ev.preventDefault(); return false; }}); }, add: function($el){ var self=this, href=$el.attr('href'); self.pages.push(href); self.total++; $el.off('click').on('click', function(e){ e.preventDefault(); self.show(self.pages.indexOf(href)); return false; }); }, next: function(){ var self=this; if(self.currentPage + 1 < self.total){ self.show(self.currentPage + 1); }else{ self.show(0); }}, prev: function(){ var self=this; if(( self.currentPage - 1) >=0){ self.show(self.currentPage - 1); }else{ self.show(self.total - 1); }}, show: function(i){ var self=this; activeMemberAjaxOnPage=null; if(self.$ajaxBoxContent.find('.rev_slider, rs-module').get(0)){ try { self.$ajaxBoxContent.find('.rev_slider, rs-module').revkill(); } catch(err){ }} self.$ajaxBoxContent.empty(); self.$ajaxBox.removeClass('ajax-box-init').addClass('ajax-box-loading'); theme.scrolltoContainer(self.$ajaxBox); self.currentPage=i; if(i < 0||i >(self.total - 1)){ self.close(); return false; } $.ajax({ url: self.pages[i], complete: function(data){ var $response=$(data.responseText), $member=$response.find('#content article.member'), $vc_css=$response.filter('style[data-type]:not("")'), vc_css=''; $vc_css.each(function(){ vc_css +=$(this).text(); }); if($('#memberAjaxCSS').get(0)){ $('#memberAjaxCSS').text(vc_css); }else{ $('').appendTo("head") } var $append=self.$ajaxBox.find('.ajax-content-append'), html=''; if($append.length) html=$append.html(); self.$ajaxBoxContent.html($member.html()).prepend('

').append('

' + html); self.$ajaxBox.removeClass('ajax-box-loading'); $(window).trigger('resize'); porto_init(); theme.refreshVCContent(self.$ajaxBoxContent); activeMemberAjaxOnPage=self; }}); }}; memberAjaxOnPage.build(); $this.data('memberAjaxOnPage', memberAjaxOnPage); }); return self; }} }); $(document.documentElement).on('keyup', function(e){ try { if(!activeMemberAjaxOnPage) return; if(e.keyCode==39){ activeMemberAjaxOnPage.next(); } if(e.keyCode==37){ activeMemberAjaxOnPage.prev(); }} catch(err){ }}); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { FilterZoom: { defaults: { elements: null }, initialize: function($elements){ this.$elements=($elements||this.defaults.elements); this.build(); return this; }, build: function(){ var self=this; self.$elements.each(function(){ var $this=$(this), zoom=$this.find('.zoom, .thumb-info-zoom').get(0); if(!zoom) return; $this.find('.zoom, .thumb-info-zoom').off('click'); var links=[]; var i=0; $this.find('article').each(function(){ var $that=$(this); if($that.css('display')!='none'){ var $zoom=$that.find('.zoom, .thumb-info-zoom'), slide, src=$zoom.data('src'), title=$zoom.data('title'); $zoom.data('index', i); if(Array.isArray(src)){ $.each(src, function(index, value){ slide={}; slide.src=value; slide.title=title[index]; links[i]=slide; i++; }); }else{ slide={}; slide.src=src; slide.title=title; links[i]=slide; i++; }} }); $this.find('article').each(function(){ var $that=$(this); if($that.css('display')!='none'){ $that.off('click', '.zoom, .thumb-info-zoom').on('click', '.zoom, .thumb-info-zoom', function(e){ var $zoom=$(this), $parent=$zoom.parents('.thumb-info'), offset=0; if($parent.get(0)){ var $slider=$parent.find('.porto-carousel'); if($slider.get(0)){ offset=$slider.data('owl.carousel').current() - $slider.find('.cloned').length / 2; }} e.preventDefault(); if($.fn.magnificPopup){ $.magnificPopup.close(); $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { items: links, gallery: { enabled: true }, type: 'image' }), $zoom.data('index') + offset); } return false; }); }}); }); return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__parallax'; var Mouseparallax=function($el, opts){ return this.initialize($el, opts); }; Mouseparallax.prototype={ initialize: function($el, opts){ this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, { wrapper: this.$el, opts: opts }); return this; }, build: function(){ if(!$.fn.parallax){ return this; } var $el=this.options.wrapper, opts=this.options.opts $el.parallax(opts); }}; $.extend(theme, { Mouseparallax: Mouseparallax }); $.fn.themeMouseparallax=function(opts){ var obj=this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Mouseparallax($this, opts); }}); return obj; }}).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var instanceName='__readmore'; var PluginReadMore=function($el, opts){ return this.initialize($el, opts); }; PluginReadMore.defaults={ buttonOpenLabel: 'Read More ', buttonCloseLabel: 'Read Less ', enableToggle: true, maxHeight: 300, overlayColor: '#43a6a3', overlayHeight: 100, startOpened: false, align: 'left' }; PluginReadMore.prototype={ initialize: function($el, opts){ var self=this; this.$el=$el; this .setData() .setOptions(opts) .build() .events() .resize(); if(self.options.startOpened){ self.options.wrapper.find('.readmore-button-wrapper > button').trigger('click'); } return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginReadMore.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this; self.options.wrapper.addClass('position-relative'); self.options.wrapper.append('
'); var backgroundCssValue='linear-gradient(180deg, rgba(2, 0, 36, 0) 0%, ' + self.options.overlayColor + ' 100%)'; if($('html').hasClass('safari')){ backgroundCssValue='-webkit-linear-gradient(top, rgba(2, 0, 36, 0) 0%, ' + self.options.overlayColor + ' 100%)' } self.options.wrapper.find('.readmore-overlay').css({ background: backgroundCssValue, position: 'absolute', bottom: 0, left: 0, width: '100%', height: self.options.overlayHeight, 'z-index': 1 }); self.options.wrapper.find('.readmore-button-wrapper').removeClass('d-none').css({ position: 'absolute', bottom: 0, left: 0, width: '100%', 'z-index': 2 }); self.options.wrapper.find('.readmore-button-wrapper > button').html(self.options.buttonOpenLabel); self.options.wrapper.css({ 'height': self.options.maxHeight, 'overflow-y': 'hidden' }); switch(self.options.align){ case 'center': self.options.wrapper.find('.readmore-button-wrapper').addClass('text-center'); break; case 'right': self.options.wrapper.find('.readmore-button-wrapper').addClass('text-end'); break; case 'left': default: self.options.wrapper.find('.readmore-button-wrapper').addClass('text-start'); break; } return this; }, events: function(){ var self=this; self.readMore=function(){ self.options.wrapper.find('.readmore-button-wrapper > button:not(.readless)').on('click', function(e){ e.preventDefault(); self.options.wrapper.addClass('opened'); var $this=$(this); setTimeout(function(){ self.options.wrapper.animate({ 'height': self.options.wrapper[0].scrollHeight }, function(){ if(!self.options.enableToggle){ $this.fadeOut(); } $this.html(self.options.buttonCloseLabel).addClass('readless').off('click'); self.readLess(); self.options.wrapper.find('.readmore-overlay').fadeOut(); self.options.wrapper.css({ 'max-height': 'none', 'overflow': 'visible' }); self.options.wrapper.find('.readmore-button-wrapper').animate({ bottom: -20 }); }); }, 200); }); } self.readLess=function(){ self.options.wrapper.find('.readmore-button-wrapper > button.readless').on('click', function(e){ e.preventDefault(); self.options.wrapper.removeClass('opened'); var $this=$(this); self.options.wrapper.find('.readmore-button-wrapper').animate({ bottom: 0 }); self.options.wrapper.find('.readmore-overlay').fadeIn(); setTimeout(function(){ self.options.wrapper.height(self.options.wrapper[0].scrollHeight).animate({ 'height': self.options.maxHeight }, function(){ $this.html(self.options.buttonOpenLabel).removeClass('readless').off('click'); self.readMore(); self.options.wrapper.css({ 'overflow': 'hidden' }); }); }, 200); }); } self.readMore(); return this; }, resize: function(){ var self=this; window.addEventListener('resize', function(){ self.options.wrapper.hasClass('opened') ? self.options.wrapper.css({ 'height': 'auto' }):self.options.wrapper.css({ 'height': self.options.maxHeight }); }) }}; $.extend(theme, { PluginReadMore: PluginReadMore }); $.fn.themePluginReadMore=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginReadMore($this, $this.data('plugin-options')); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var instanceName='__mousehoversplit'; var PluginHoverSplit=function($el){ return this.initialize($el); } PluginHoverSplit.prototype={ initialize: function($el){ if($el.data(instanceName)){ return this; } this.$el=$el.addClass('slide-wrapper'); this .setData() .event(); return this; }, setData: function(){ this.$el.data(instanceName, this); this.$el.addClass('initialized'); var $columns=this.$el.find('>.split-slide'); for(var index=0; index < $columns.length; index++){ var column=$columns[index]; if(index==0){ column.classList.add('slide-left'); this.left=column; }else if(index==1){ column.classList.add('slide-right'); break; }} return this; }, event: function(){ this.refresh(); this.refreshFunc=this.refresh.bind(this); $(window).on('resize', this.refreshFunc); this.handleMoveFunc=this.handleMove.bind(this); $(document.body).on('mousemove', this.handleMoveFunc); }, handleMove: function(e){ if(e.clientX < this.$el.offset().left){ this.left.style.width='0'; }else{ this.left.style.width=`calc(${(e.clientX - this.$el.offset().left) /(this.$el.innerWidth()) * 100 }% - 3px) `; }}, refresh: function(e){ if(e&&e.type=='resize'){ this.$el.css('min-height', $(this.left).height()); } this.$el.find('>.split-slide>*').css('width', this.$el.innerWidth()); }, clearData: function(){ this.$el.removeClass('slide-wrapper').removeData(instanceName).css('min-height', ''); this.$el.find('>*').removeClass('slide-left slide-right').css('width', ''); $(window).off('resize', this.refreshFunc); $(document.body).off('mousemove', this.handleMoveFunc); }} $.extend(theme, { PluginHoverSplit: PluginHoverSplit }); $.fn.themePluginHoverSplit=function(){ return this.map(function(){ var $this=$(this), $splitColumns=$this.find('>.split-slide'); if($splitColumns.length >=2){ if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginHoverSplit($this); }} }); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var instanceName='__horizontalscroller'; var PluginHScroller=function($el, opts){ return this.initialize($el, opts); } PluginHScroller.defaults={ lg: 3, md: 1, init_refresh: false, }; PluginHScroller.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData(opts) .build() .event(); return this; }, setData: function(opts){ this.$el.data(instanceName, this); this.options=$.extend(true, {}, PluginHScroller.defaults, opts); this.$hScroller=this.$el.find('.horizontal-scroller'); this.$hScrollerItems=this.$hScroller.find('.horizontal-scroller-items'); this.$hScrollerItems.find('>*').addClass('horizontal-scroller-item'); return this; }, build: function(){ this.originalScrollHTML=this.$hScroller.html(); this.scrollerInitialized=false; return this; }, generateScroller: function(){ var items=gsap.utils.toArray(this.$hScrollerItems.find('.horizontal-scroller-item')); gsap.to(items, { xPercent: -100 *(items.length -($(window).width() > 991 ? this.options.lg:this.options.md)), ease: 'none', scrollTrigger: { trigger: '.horizontal-scroller', pin: true, scrub: 1, snap: 1 /(items.length - 1), end: ()=> '+=' + this.$hScrollerItems.width(), el: this.$el, }}); this.scrollerInitialized=true; }, event: function(){ if(this.options.init_refresh){ this.generateScroller(); } this.scrollFunc=this.scroll.bind(this); $(window).on('scroll', this.scrollFunc); this.afterResizeFunc=this.afterResize.bind(this); $(window).on('afterResize', this.afterResizeFunc); }, scroll: function(){ if(!this.scrollerInitialized){ var position=this.$el[0].getBoundingClientRect(); if(position.top >=0&&position.top < window.innerHeight&&position.bottom >=0){ this.generateScroller(); }} }, afterResize: function(){ this.scrollerInitialized=false; var Alltrigger=ScrollTrigger.getAll(); for(var i=0; i < Alltrigger.length; i++){ if(Alltrigger[i]['vars']&&typeof Alltrigger[i]['vars']['el']!='undefined'&&Alltrigger[i]['vars']['el']==this.$el){ Alltrigger[i].kill(true); this.$el.empty().html('
' + this.originalScrollHTML + '
'); this.$hScrollerItems=this.$el.find('.horizontal-scroller-items'); break; }} }, clearData: function(){ this.$el.removeData(instanceName); $(window).off('scroll', this.scrollFunc); $(window).off('afterResize', this.afterResizeFunc); }}; $.extend(theme, { PluginHScroller: PluginHScroller }); $.fn.themePluginHScroller=function(opt=false){ if(typeof gsap!=='undefined'&&typeof ScrollTrigger!=='undefined'){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ if($this.find('.horizontal-scroller-items>*').length){ options=$this.data('plugin-hscroll'); if(opt){ options['init_refresh']=true; } return new PluginHScroller($this, options); }} }); }else{ return false; }} }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var instanceName='__textimagefloating'; var PluginTImageFloaing=function($el, opts){ return this.initialize($el, opts); }; PluginTImageFloaing.defaults={ offset: 0, }; PluginTImageFloaing.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData(opts) .event(); return this; }, setData: function(opts){ this.options=$.extend(true, {}, PluginTImageFloaing.defaults, opts); this.$el.data(instanceName, this); return this; }, event: function(){ this.mouseEnterFunc=this.mouseEnter.bind(this); this.$el.on('mouseenter', this.mouseEnterFunc); this.mouseOutFunc=this.mouseOut.bind(this); this.$el.on('mouseleave', this.mouseOutFunc); }, mouseEnter: function(e){ $('.thumb-info-floating-element-clone').remove(); $('.thumb-info-floating-element', this.$el).clone().addClass('thumb-info-floating-element-clone').removeClass('d-none').appendTo(document.body); $img=$('.thumb-info-floating-element-clone').find('img.porto-lazyload'); if($img.length&&$img.data('oi')){ $img.attr('src', $img.data('oi')); } $('.thumb-info-floating-element-clone').css({ left: e.clientX + parseInt(this.options.offset), top: e.clientY + parseInt(this.options.offset) }).fadeIn(300); gsap.to('.thumb-info-floating-element-clone', 0.5, { css: { scaleX: 1, scaleY: 1 }}); this.mouseMoveFunc=this.mouseMove.bind(this); $(document.body).on('mousemove', this.mouseMoveFunc); }, mouseMove: function(e){ gsap.to('.thumb-info-floating-element-clone', 0.5, { css: { left: e.clientX + parseInt(this.options.offset), top: e.clientY + parseInt(this.options.offset) }}); }, mouseOut: function(e){ gsap.to('.thumb-info-floating-element-clone', 0.5, { css: { scaleX: 0.5, scaleY: 0.5, opacity: 0 }}); }, clearData: function(e){ $('.thumb-info-floating-element-clone').remove(); this.$el.off('mouseenter', this.mouseEnterFunc); this.$el.off('mouseout', this.mouseOutFunc); $(document.body).off('mousemove', this.mouseMoveFunc); }} $.extend(theme, { PluginTImageFloaing: PluginTImageFloaing }); $.fn.themePluginTIFloating=function(){ if(typeof gsap!=='undefined'){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginTImageFloaing($this, $this.data('plugin-tfloating')); }}); }else{ return false; }} }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme.initAsync=function($wrap, wrapObj){ if($.fn.themeAnimate){ $(function(){ var svgAnimates=wrapObj.querySelectorAll('svg [data-appear-animation]'); if(svgAnimates.length){ $(svgAnimates).closest('svg').attr('data-appear-animation-svg', '1'); } var $animates=wrapObj.querySelectorAll('[data-plugin-animate], [data-appear-animation], [data-appear-animation-svg]'); if($animates.length){ var animateResize=function(){ if(window.innerWidth < 768){ window.removeEventListener('resize', animateResize); $animates.forEach(function(o){ o.classList.add('appear-animation-visible'); }); }}; if(theme.animation_support){ window.addEventListener('resize', animateResize); theme.dynIntObsInit($animates, 'themeAnimate', theme.Animate.defaults); }else{ $animates.forEach(function(o){ o.classList.add('appear-animation-visible'); }); }} }); } if($.fn.themePluginAnimatedLetters){ if($('[data-plugin-animated-letters]').length||$('.animated-letters').length){ theme.intObs('[data-plugin-animated-letters]:not(.manual), .animated-letters', 'themePluginAnimatedLetters'); } if($('[data-plugin-animated-words]').length||$('.animated-words').length){ theme.intObs('[data-plugin-animated-words]:not(.manual), .animated-words', 'themePluginAnimatedLetters'); }} if($.fn.themeCarousel){ $(function(){ var portoCarouselInit=function(e){ var $this=$(e.currentTarget); $this.find('[data-appear-animation]:not(.appear-animation)').addClass('appear-animation'); if($this.find('.owl-item.cloned').length){ $this.find('.porto-lazyload:not(.lazy-load-loaded)').themePluginLazyLoad({ effect: 'fadeIn', effect_speed: 400 }); var $animates=e.currentTarget.querySelectorAll('.appear-animation'); if($animates.length){ theme.dynIntObsInit($animates, 'themeAnimate', theme.Animate.defaults); } if($.fn.themePluginAnimatedLetters&&($(this).find('.owl-item.cloned [data-plugin-animated-letters]:not(.manual)').length)){ theme.dynIntObsInit($(this).find('.owl-item.cloned [data-plugin-animated-letters]:not(.manual)'), 'themePluginAnimatedLetters'); }} setTimeout(function(){ var $hiddenItems=$this.find('.owl-item:not(.active)'); if(!$('html').hasClass('no-csstransitions')&&window.innerWidth > 767){ $hiddenItems.find('.appear-animation').removeClass('appear-animation-visible'); $hiddenItems.find('.appear-animation').each(function(){ var $el=$(this), delay=Math.abs($el.data('appear-animation-delay') ? $el.data('appear-animation-delay'):0); if(delay > 1){ this.style.animationDelay=delay + 'ms'; } var duration=Math.abs($el.data('appear-animation-duration') ? $el.data('appear-animation-duration'):1000); if(1000!=duration){ this.style.animationDuration=duration + 'ms'; }}); } if(window.innerWidth >=1200){ $hiddenItems.find('[data-vce-animate]').removeAttr('data-vcv-o-animated'); }}, 300); }; var portoCarouselTranslated=function(e){ var $this=$(e.currentTarget); var $active=$this.find('.owl-item.active'); if($active.hasClass('translating')){ $active.removeClass('translating'); return; } $this.find('.owl-item.translating').removeClass('translating'); $this.find('[data-plugin-animated-letters]').removeClass('invisible'); $this.find('.owl-item.active [data-plugin-animated-letters]').trigger('animated.letters.initialize'); if(window.innerWidth > 767){ $this.find('.appear-animation').removeClass('appear-animation-visible'); $active.find('.appear-animation').each(function(){ var $animation_item=$(this), anim_name=$animation_item.data('appear-animation'); $animation_item.addClass(anim_name + ' appear-animation-visible'); }); } if(window.innerWidth > 991){ if($this.closest('[data-plugin-sticky]').length){ theme.refreshStickySidebar(false, $this.closest('[data-plugin-sticky]')); }} $active.find('.slide-animate').each(function(){ var $animation_item=$(this), settings=$animation_item.data('settings'); if(settings&&(settings._animation||settings.animation)){ var animation=settings._animation||settings.animation, delay=settings._animation_delay||settings.animation_delay||0; theme.requestTimeout(function(){ $animation_item.removeClass('elementor-invisible').addClass('animated ' + animation); }, delay); }}); if(window.innerWidth >=1200){ $this.find('[data-vce-animate]').removeAttr('data-vcv-o-animated').removeAttr('data-vcv-o-animated-fully'); $active.find('[data-vce-animate]').each(function(){ var $animation_item=$(this); if($animation_item.data('porto-origin-anim')){ var anim_name=$animation_item.data('porto-origin-anim'); $animation_item.attr('data-vce-animate', anim_name).attr('data-vcv-o-animated', true); var duration=parseFloat(window.getComputedStyle(this)['animationDuration']) * 1000, delay=parseFloat(window.getComputedStyle(this)['animationDelay']) * 1000; window.setTimeout(function(){ $animation_item.attr('data-vcv-o-animated-fully', true); }, delay + duration + 5); }}); }}; var portoCarouselTranslateVC=function(e){ var $this=$(e.currentTarget); $this.find('.owl-item.active').addClass('translating'); if(window.innerWidth >=1200){ $this.find('[data-vce-animate]').each(function(){ var $animation_item=$(this); $animation_item.data('porto-origin-anim', $animation_item.data('vce-animate')).attr('data-vce-animate', ''); }); }}; var portoCarouselTranslateElementor=function(e){ var $this=$(e.currentTarget); $this.find('.owl-item.active').addClass('translating'); $this.find('.owl-item:not(.active) .slide-animate').addClass('elementor-invisible'); $this.find('.slide-animate').each(function(){ var $animation_item=$(this), settings=$animation_item.data('settings'); if(settings._animation||settings.animation){ $animation_item.removeClass(settings._animation||settings.animation); }}); }; var portoCarouselTranslateWPB=function(e){ if(window.innerWidth > 767){ var $this=$(e.currentTarget); $this.find('.owl-item.active').addClass('translating'); $this.find('.appear-animation').each(function(){ var $animation_item=$(this); $animation_item.removeClass($animation_item.data('appear-animation')); }); }}; var carouselItems=$wrap.find('.owl-carousel:not(.manual)'); carouselItems.on('initialized.owl.carousel refreshed.owl.carousel', portoCarouselInit).on('translated.owl.carousel', portoCarouselTranslated); carouselItems.on('translate.owl.carousel', function(){ $(this).find('[data-plugin-animated-letters]').addClass('invisible'); $(this).find('[data-plugin-animated-letters]').trigger('animated.letters.destroy'); }); carouselItems.filter(function(){ if($(this).find('[data-vce-animate]').length){ return true; } return false; }).on('translate.owl.carousel', portoCarouselTranslateVC); carouselItems.filter(function(){ var $anim_obj=$(this).find('.elementor-invisible'); if($anim_obj.length){ $anim_obj.addClass('slide-animate'); return true; } return false; }).on('translate.owl.carousel', portoCarouselTranslateElementor); carouselItems.filter(function(){ if($(this).find('.appear-animation, [data-appear-animation]').length){ return true; } return false; }).on('translate.owl.carousel', portoCarouselTranslateWPB); $wrap.find('[data-plugin-carousel]:not(.manual), .porto-carousel:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; setTimeout(function(){ $this.themeCarousel(opts); }, 0); }); }); } $wrap.find('.thumb-gallery-thumbs, .thumbnail-gallery').each(function(){ var $thumbs=$(this), $detail=$thumbs.parent().find('.thumb-gallery-detail'), flag=false, duration=300; if($thumbs.data('initThumbs')) return; $detail.on('changed.owl.carousel', function(e){ if(!flag){ flag=true; var len=$detail.find('.owl-item').length, cloned=$detail.find('.cloned').length; if(len){ $thumbs.trigger('to.owl.carousel', [(e.item.index - cloned / 2 - 1) % len, duration, true]); } flag=false; }}); $thumbs.on('changed.owl.carousel', function(e){ if(!flag){ flag=true; var len=$thumbs.find('.owl-item').length, cloned=$thumbs.find('.cloned').length; if(len){ $detail.trigger('to.owl.carousel', [(e.item.index - cloned / 2) % len, duration, true]); } flag=false; }}).on('click', '.owl-item', function(){ if(!flag){ flag=true; var len=$thumbs.find('.owl-item').length, cloned=$thumbs.find('.cloned').length; if(len){ $detail.trigger('to.owl.carousel', [($(this).index() - cloned / 2) % len, duration, true]); } flag=false; }}).data('initThumbs', true); }); $wrap.find('.video-fixed').each(function(){ var $this=$(this), $video=$this.find('video, iframe'); if($video.length){ window.addEventListener('scroll', function(){ var offset=$(window).scrollTop() - $this.position().top + theme.adminBarHeight(); $video.css("cssText", "top: " + offset + "px !important;"); }, { passive: true }); }}); }; $(document.body).trigger('porto_async_init'); }).apply(this, [window.theme, jQuery]); jQuery(document).ready(function($){ 'use strict'; if($.fn.themeVcImageZoom){ $(function(){ var $galleryParent=null; $('.porto-vc-zoom:not(.manual)').each(function(){ var $this=$(this), opts, gallery=$this.attr('data-gallery'); var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; if(typeof opts=="undefined"){ opts={};} opts.container=$this.parent(); if(gallery=='true'){ var container='vc_row'; if($this.attr('data-container')) container=$this.attr('data-container'); var $parent=$($this.closest('.' + container).get(0)); if($parent.length > 0&&$galleryParent!=null&&$galleryParent.is($parent)){ return; }else if($parent.length > 0){ $galleryParent=$parent; } if($galleryParent!=null&&$galleryParent.length > 0){ opts.container=$galleryParent; }} $this.themeVcImageZoom(opts); }); }); } function porto_modal_open($this){ var trigger=$this.data('trigger-id'), overlayClass=$this.data('overlay-class'), extraClass=$this.data('extra-class') ? $this.data('extra-class'):'', type=$this.data('type'); if(typeof trigger!='undefined'){ if(typeof type=='undefined'){ type='inline'; } if(type=='inline'){ trigger='#' + escape(trigger); } var args={ items: { src: trigger }, type: type, mainClass: extraClass }; if($this.hasClass('porto-onload')){ args['callbacks']={ 'beforeClose': function(){ if($('.mfp-wrap .porto-disable-modal-onload').length&&($('.mfp-wrap .porto-disable-modal-onload').is(':checked')||$('.mfp-wrap .porto-disable-modal-onload input[type="checkbox"]').is(':checked'))){ $.cookie('porto_modal_disable_onload', 'true', { expires: 7 }); }} };} if(typeof overlayClass!="undefined"&&overlayClass){ args.mainClass +=escape(overlayClass); } setTimeout(()=> { $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, args), 0); }); }} function porto_init_magnific_popup_functions($wrap){ if(typeof $wrap=='undefined'||!$wrap.length){ $wrap=$(document.body); } $wrap.find('.lightbox:not(.manual)').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('lightbox-options'); if(pluginOptions){ opts=pluginOptions; }else{ pluginOptions=$this.data('plugin-options'); if(typeof pluginOptions!='object'){ pluginOptions=JSON.parse(pluginOptions); } if(pluginOptions){ opts=pluginOptions; }} $this.themeLightbox(opts); }); $wrap.find('.porto-popup-iframe').magnificPopup($.extend(true, {}, theme.mfpConfig, { disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false })); $wrap.find('.porto-popup-ajax').magnificPopup($.extend(true, {}, theme.mfpConfig, { type: 'ajax' })); $wrap.find('.porto-popup-content').each(function(){ var animation=$(this).attr('data-animation'); $(this).magnificPopup($.extend(true, {}, theme.mfpConfig, { type: 'inline', fixedContentPos: false, fixedBgPos: true, overflowY: 'auto', closeBtnInside: true, preloader: false, midClick: true, removalDelay: 300, mainClass: animation })); }); $wrap.find('.popup-youtube, .popup-vimeo, .popup-gmaps').each(function(index){ var overlayClass=$(this).find('.porto-modal-trigger').data('overlay-class'), args={ type: 'iframe', removalDelay: 160, preloader: false, fixedContentPos: false }; if(typeof overlayClass!="undefined"&&overlayClass){ args.mainClass=escape(overlayClass); } $(this).magnificPopup(args); }); if($wrap.find('.porto-modal-trigger.porto-onload').length){ var $obj=$wrap.find('.porto-modal-trigger.porto-onload').eq(0), timeout=0; if($obj.data('timeout')){ timeout=parseInt($obj.data('timeout'), 10); } setTimeout(function(){ porto_modal_open($obj); }, timeout); } $wrap.on('click', '.porto-modal-trigger', function(e){ e.preventDefault(); porto_modal_open($(this)); }); if($wrap.hasClass('login-popup')){ $wrap.find('.porto-link-login, .porto-link-register').magnificPopup({ items: { src: theme.ajax_url + '?action=porto_account_login_popup&nonce=' + js_porto_vars.porto_nonce, type: 'ajax' }, tLoading: '', callbacks: { ajaxContentAdded: function(){ $(window).trigger('porto_login_popup_opened'); }} }); } $wrap.find('.product-images').magnificPopup($.extend(true, {}, theme.mfpConfig, { delegate: '.img-thumbnail a.zoom', type: 'image', gallery: { enabled: true }}) ); $wrap.find('.porto-posts-grid').each(function(){ $(this).magnificPopup($.extend(true, {}, theme.mfpConfig, { delegate: '.porto-tb-featured-image span.zoom, .porto-tb-featured-image a.zoom, .post-image span.zoom', type: 'image', gallery: { enabled: true }}) ); }); $wrap.find('.porto-posts-grid .tb-image-type-slider div.zoom').each(function(){ var $this=$(this), links=[]; $this.find('a').each(function(){ var slide={}; slide.src=$(this).attr('href'); slide.title=$(this).attr('title'); links.push(slide); }); if(links.length){ $this.on('click', function(){ var $slider=$this.siblings('.porto-carousel'); if($slider.length){ var offset=$slider.data('owl.carousel').current() - $slider.find('.cloned').length / 2; $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { items: links, gallery: { enabled: true }, type: 'image' }), offset); }}); }}); } if($.fn.magnificPopup){ porto_init_magnific_popup_functions(); }else{ setTimeout(function(){ if($.fn.magnificPopup){ porto_init_magnific_popup_functions(); }}, 500); } $(document.body).on('porto_load_posts_end', function(e, $posts_wrap){ if($.fn.magnificPopup){ porto_init_magnific_popup_functions($posts_wrap); }}); if(typeof theme.PostAjaxModal!=='undefined'){ if($('.page-portfolios').length){ theme.PostAjaxModal.initialize($('.page-portfolios')); } if($('.page-members').length){ theme.PostAjaxModal.initialize($('.page-members'), 'member'); }} if(typeof theme.PortfolioAjaxPage!=='undefined'){ theme.PortfolioAjaxPage.initialize(); } if(typeof theme.PostFilter!=='undefined'){ var $postFilterElements=$('ul[data-filter-type], .portfolio-filter, .member-filter, .faq-filter, .porto-ajax-filter.product-filter, .porto-ajax-filter.post-filter'); if($postFilterElements.length){ theme.PostFilter.initialize($postFilterElements); }} $('body').on('click', '.porto-ajax-load .pagination:not(.load-more) .page-numbers', function(e){ var $this=$(this); if($this.hasClass('current')||$this.hasClass('dots')){ return; } e.preventDefault(); var $wrap=$this.closest('.porto-ajax-load'), post_type=$wrap.data('post_type'), $obj=$wrap.find('.' + post_type + 's-container'); if(!$obj.length||$wrap.hasClass('loading')){ return; } $wrap.addClass('loading'); var $filter=$wrap.find('.porto-ajax-filter'), cat=$filter.length&&$filter.children('.active').length&&$filter.children('.active').data('filter'); if('*'==cat){ cat=''; } var default_args={}, page=$this.attr('href').match(/paged=(\d+)|page\/(\d+)/); if(page&&Array.isArray(page)&&(page[1]||page[2])){ default_args['page']=parseInt(page[1]||page[2]); }else{ if($this.hasClass('prev')){ default_args['page']=parseInt($this.next().text()); }else if($this.hasClass('next')){ default_args['page']=parseInt($this.prev().text()); }else{ default_args['page']=parseInt($this.text()); }} theme.PostFilter.load_posts(cat, $wrap.hasClass('load-infinite'), $wrap, post_type, $obj, default_args, $this.attr('href')); }); if(typeof theme.MemberAjaxPage!=='undefined'){ theme.MemberAjaxPage.initialize(); } if(typeof theme.FilterZoom!=='undefined'){ theme.FilterZoom.initialize($('.page-portfolios')); theme.FilterZoom.initialize($('.page-members')); theme.FilterZoom.initialize($('.blog-posts-related')); } function portoSetHoverImage($this, enter=true){ var $item=$this.find('[data-hoverlay-image]'), $postsGrid=$this.closest('.porto-posts-grid'); if($item.length){ var $target=$postsGrid.find('#himg-' + $item.data('hoverlay-id')); if(enter){ $target.addClass('active'); $postsGrid.addClass('active'); }else{ $target.removeClass('active'); $postsGrid.removeClass('active'); }} } function InsertHoverImage($this){ var $option=$this.data('hoverlay-image'), $postsGrid=$this.closest('.porto-posts-grid'), $postsWrap=$this.closest('.posts-wrap'); $postsGrid.append('
'); $postsGrid.addClass('image-hover-overlay'); if($postsWrap.hasClass('owl-carousel')){ $postsWrap.on('refreshed.owl.carousel resized.owl.carousel', function(){ $postsGrid.find('.thumb-info-full').css('--porto-himg-height',($postsWrap.innerHeight() + 'px')); }) }else{ $(window).on('resize', function(){ $postsGrid.find('.thumb-info-full').css('--porto-himg-height',($postsWrap.innerHeight() + 'px')); }); } $('.image-hover-overlay').on('mouseenter touchstart', '.porto-tb-item', function(e){ portoSetHoverImage($(this)); }); $('.image-hover-overlay').on('mouseleave touchend', '.porto-tb-item', function(e){ portoSetHoverImage($(this), false); }); } $.extend(theme, { InsertHoverImage: InsertHoverImage }); $('.porto-posts-grid [data-hoverlay-image]').each(function(){ theme.InsertHoverImage($(this)); }); var $minicart_offcanvas=$('.minicart-offcanvas'), $wl_offcanvas=$('.wishlist-offcanvas'), $mobile_sidebar=$('.mobile-sidebar'), $mobile_panel=$('#side-nav-panel'), $overlay_search=$('#header .btn-close-search-form'), $html=$('html'); if($minicart_offcanvas.length||$wl_offcanvas.length||$mobile_sidebar.length||$mobile_panel.length||$('.skeleton-loading').length||$overlay_search.length){ $(document.documentElement).on('keyup', function(e){ try { if(e.keyCode==27){ $minicart_offcanvas.removeClass('minicart-opened'); $wl_offcanvas.removeClass('minicart-opened'); if($mobile_sidebar.length){ $html.removeClass('filter-sidebar-opened'); $html.removeClass('sidebar-opened'); $('.sidebar-overlay').removeClass('active'); } if($mobile_panel.length&&$html.hasClass('panel-opened')){ $html.removeClass('panel-opened'); $('.panel-overlay').removeClass('active'); } if($overlay_search.length){ $overlay_search.trigger('click'); }} } catch(err){ }}); $('.skeleton-loading').on('skeleton-loaded', function(){ $mobile_sidebar=$('.mobile-sidebar'); }); } if($.fn.themeMouseparallax){ $(function(){ $('[data-plugin="mouse-parallax"]').each(function(){ var $this=$(this), opts; if($this.data('parallax')){ $this.parallax('disable'); $this.removeData('parallax'); $this.removeData('options'); } if($this.hasClass('elementor-element')){ $this.children('.elementor-widget-container, .elementor-container, .elementor-widget-wrap, .elementor-column-wrap').addClass('layer').attr('data-depth', $this.attr('data-floating-depth')); }else{ $this.children('.layer').attr('data-depth', $this.attr('data-floating-depth')); } var pluginOptions=$this.data('options'); if(pluginOptions) opts=pluginOptions; $this.themeMouseparallax(opts); }); }); } if($.fn['themePluginReadMore']&&$('[data-plugin-readmore]').length){ $('[data-plugin-readmore]:not(.manual)').themePluginReadMore(); } if($.fn.themePluginHoverSplit){ $('.mouse-hover-split').each(function(){ var $this=$(this), $splitSlide=$this.find('>.split-slide'); if($splitSlide.length >=2){ $this.themePluginHoverSplit(); }}); } if($.fn.themePluginHScroller){ $('.horizontal-scroller-wrapper').each(function(){ $(this).themePluginHScroller(true); }); } if($.fn.themePluginTIFloating){ $('.thumb-info-floating-element-wrapper[data-plugin-tfloating]').each(function(){ $(this).themePluginTIFloating(); }); }}); (function(theme, $){ if($('.wishlist-popup').length){ var worker=null; $('.wishlist-offcanvas .my-wishlist').on('click', function(e){ e.preventDefault(); $(this).parent().toggleClass('minicart-opened'); }); $('.wishlist-offcanvas .minicart-overlay').on('click', function(){ $(this).closest('.wishlist-offcanvas').removeClass('minicart-opened'); }); var init_wishlist=function(){ worker=new Worker(js_porto_vars.ajax_loader_url.replace('/images/ajax-loader@2x.gif', '/js/woocommerce-worker.js')); worker.onmessage=function(e){ $('.wishlist-popup').html(e.data); }; worker.postMessage({ initWishlist: true, ajaxurl: theme.ajax_url, nonce: js_porto_vars.porto_nonce }); }; if(theme&&theme.isLoaded){ setTimeout(function(){ init_wishlist(); }, 100); }else{ $(window).on('load', function(){ init_wishlist(); }); } $('.wishlist-popup').on('click', '.remove_from_wishlist', function(e){ e.preventDefault(); var $this=$(this), id=$this.attr('data-product_id'), $table=$('.wishlist_table #yith-wcwl-row-' + id + ' .remove_from_wishlist'); $this.closest('.wishlist-item').find('.ajax-loading').show(); if($table.length){ $table.trigger('click'); }else{ if(typeof yith_wcwl_l10n!=='undefined'){ $.ajax({ url: yith_wcwl_l10n.ajax_url, data: { action: yith_wcwl_l10n.actions.remove_from_wishlist_action, remove_from_wishlist: id, nonce: typeof yith_wcwl_l10n.nonce!=='undefined' ? yith_wcwl_l10n.nonce.remove_from_wishlist_nonce:'', from: 'theme' }, method: 'post', success: function(data){ var $wcwlWrap=$('.yith-wcwl-add-to-wishlist.add-to-wishlist-' + id); if($wcwlWrap.length){ var fragmentOptions=$wcwlWrap.data('fragment-options'), $link=$wcwlWrap.find('a'); if($link.length){ if(fragmentOptions.in_default_wishlist){ delete fragmentOptions.in_default_wishlist; $wcwlWrap.attr(JSON.stringify(fragmentOptions)); } $wcwlWrap.removeClass('exists'); $wcwlWrap.find('.yith-wcwl-wishlistexistsbrowse').addClass('yith-wcwl-add-button').removeClass('yith-wcwl-wishlistexistsbrowse'); $wcwlWrap.find('.yith-wcwl-wishlistaddedbrowse').addClass('yith-wcwl-add-button').removeClass('yith-wcwl-wishlistaddedbrowse'); $link.attr('href', location.href + '?post_type=product&add_to_wishlist=' + id).attr('data-product-id', id).attr('data-product-type', fragmentOptions.product_type); var text=$('.single_add_to_wishlist').data('title'); if(!text){ text='Add to wishlist'; } $link.attr('title', text).attr('data-title', text).addClass('add_to_wishlist single_add_to_wishlist').html('' + text + ''); }} $(document.body).trigger('removed_from_wishlist'); }}); }} }); $(document.body).on('added_to_wishlist removed_from_wishlist', function(e){ if(worker){ worker.postMessage({ loadWishlist: true, ajaxurl: theme.ajax_url, nonce: js_porto_vars.porto_nonce }); }}); } var $youtube_videos=$('.porto-video-social.video-youtube'); if($youtube_videos.length){ window.onYouTubeIframeAPIReady=function(){ $youtube_videos.each(function(){ var $this=$(this), $wrap=$this.parent('.video-wrapper'), item_id=$this.attr('id'), youtube_id=$this.data('video'), is_loop=$this.data('loop'), enable_audio=$this.data('audio'), autoplay=1, controls=0; if('0'===$this.data('autoplay')){ autoplay=0; } if($this.data('controls')){ controls=parseInt($this.data('controls')); } new YT.Player(item_id, { width: '100%', videoId: youtube_id, playerVars: { 'autoplay': autoplay, 'controls': controls, 'modestbranding': 1, 'rel': 0, 'playsinline': 1, 'showinfo': 0, 'loop': is_loop }, events: { onReady: function(t){ if($wrap.length){ $wrap.themeFitVideo(); } if(0===parseInt(enable_audio)&&t && t.target&&t.target.mute){ t.target.mute(); }} }}); }); }; if($('script[src*="www.youtube.com/iframe_api"]').length){ setTimeout(onYouTubeIframeAPIReady, 350); }else{ var tag=document.createElement('script'); tag.src="//www.youtube.com/iframe_api"; var firstScriptTag=document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); }} var $vimeo_videos=$('.porto-video-social.video-vimeo'); if($vimeo_videos.length){ var portoVimeoInit=function(){ $vimeo_videos.each(function(){ var $this=$(this), $wrap=$this.parent('.fit-video'), item_id=$this.attr('id'), video_id=$this.data('video'), is_loop=$this.data('loop'), enable_audio=$this.data('audio'), autoplay=true; if('0'===$this.data('autoplay')){ autoplay=false; } var player=new Vimeo.Player(item_id, { id: video_id, loop: 1===parseInt(is_loop) ? true:false, autoplay: autoplay, transparent: false, background: true, muted: 0===parseInt(enable_audio) ? true:false, events: { onReady: function(t){ if($wrap.length){ $wrap.themeFitVideo(); } if(0===parseInt(enable_audio)&&t && t.target&&t.target.mute){ t.target.mute(); }} }}); if(0===parseInt(enable_audio)){ player.setVolume(0); } if($wrap.length){ player.ready().then(function(){ $wrap.themeFitVideo(); }); }}); }; if($('script[src="https://player.vimeo.com/api/player.js"]').length){ setTimeout(portoVimeoInit, 350); }else{ var tag=document.createElement('script'); tag.addEventListener('load', function(event){ setTimeout(portoVimeoInit, 50); }); tag.src="https://player.vimeo.com/api/player.js"; var firstScriptTag=document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); }} }).apply(this, [window.theme, jQuery]); (function(){ 'use strict'; function portoCalcSliderButtonsPosition($parent, padding){ var $buttons=$parent.find('.show-nav-title .owl-nav'); if($buttons.length){ if(window.theme.rtl){ $buttons.css('left', padding); }else{ $buttons.css('right', padding); } if($buttons.closest('.porto-products').length&&$buttons.closest('.porto-products').parent().children('.products-slider-title').length){ var $title=$buttons.closest('.porto-products').parent().children('.products-slider-title'), newMT=$title.offset().top - $parent.offset().top - parseInt($title.css('padding-top'), 10) - parseInt($title.css('line-height'), 10) / 2 + $buttons.children().outerHeight() - parseInt($buttons.children().css('margin-top'), 10); $buttons.css('margin-top', newMT); }} } (function(theme, $){ theme=theme||{}; var instanceName='__wooWidgetToggle'; var WooWidgetToggle=function($el, opts){ return this.initialize($el, opts); }; WooWidgetToggle.defaults={ }; WooWidgetToggle.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, WooWidgetToggle.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var $el=this.options.wrapper; $el.parent().removeClass('closed'); if(!$el.find('.toggle').length){ $el.append(''); } $el.find('.toggle').on('click', function(){ if($el.next().is(":visible")){ $el.parent().addClass('closed'); }else{ $el.parent().removeClass('closed'); } $el.next().stop().slideToggle(200); theme.refreshVCContent(); }); return this; }}; $.extend(theme, { WooWidgetToggle: WooWidgetToggle }); $.fn.themeWooWidgetToggle=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.WooWidgetToggle($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var instanceName='__wooWidgetAccordion'; var WooWidgetAccordion=function($el, opts){ return this.initialize($el, opts); }; WooWidgetAccordion.defaults={ }; WooWidgetAccordion.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, WooWidgetAccordion.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.wrapper; $el.find('ul.children').each(function(){ var $this=$(this); if(!$this.prev().hasClass('toggle')){ $this.before($('').on('click', function(){ var $that=$(this); if($that.next().is(":visible")){ $that.parent().removeClass('open').addClass('closed'); }else{ $that.parent().addClass('open').removeClass('closed'); } $that.next().stop().slideToggle(200); theme.refreshVCContent(); }) ); }}); $el.find('li[class*="current-"]').addClass('current'); return this; }}; $.extend(theme, { WooWidgetAccordion: WooWidgetAccordion }); $.fn.themeWooWidgetAccordion=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.WooWidgetAccordion($this, opts); }}); }}).apply(this, [window.theme, jQuery]); if(typeof jQuery.fn.owlCarousel=='function'){ (function(theme, $){ theme=theme||{}; var instanceName='__wooProductsSlider'; var WooProductsSlider=function($el, opts){ return this.initialize($el, opts); }; WooProductsSlider.defaults={ rtl: theme.rtl, autoplay: theme.slider_autoplay=='1' ? true:false, autoplayTimeout: theme.slider_speed ? theme.slider_speed:5000, loop: theme.slider_loop, nav: false, navText: ["", ""], dots: false, autoplayHoverPause: true, items: 1, responsive: {}, autoHeight: true, lazyLoad: true }; WooProductsSlider.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, true); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, WooProductsSlider.defaults, opts, { wrapper: this.$el }); return this; }, calcOwlHeight: function($el){ var h=0; $el.find('.owl-item.active').each(function(){ if(h < $(this).height()) h=$(this).height(); }); $el.find('.owl-stage-outer').height(h); }, build: function(){ var self=this, $el=this.options.wrapper, lg=this.options.lg, md=this.options.md, xs=this.options.xs, ls=this.options.ls, $slider_wrapper=$el.closest('.slider-wrapper'), single=this.options.single, dots=this.options.dots, nav=this.options.nav, responsive={}, items, scrollWidth=0, count=$el.find('> *').length, w_xs=576 - scrollWidth, w_md=768 - scrollWidth, w_lg=parseInt(js_porto_vars.screen_lg) - scrollWidth, w_sl=1400 - scrollWidth; if($el.find('.product-col').get(0)){ portoCalcSliderButtonsPosition($slider_wrapper, $el.find('.product-col').css('padding-left')); } if(single){ items=1; }else{ items=lg ? lg:1; if(this.options.xl){ responsive[w_sl]={ items: this.options.xl, loop:(this.options.loop&&count > this.options.xl) ? true:false };} responsive[w_lg]={ items: items, loop:(this.options.loop&&count > items) ? true:false }; if(md) responsive[w_md]={ items: md, loop:(this.options.loop&&count > md) ? true:false }; if(xs) responsive[w_xs]={ items: xs, loop:(this.options.loop&&count > xs) ? true:false }; if(ls) responsive[0]={ items: ls, loop:(this.options.loop&&count > ls) ? true:false };} this.options=$.extend(true, {}, this.options, { loop:(this.options.loop&&count > items) ? true:false, items: items, responsive: responsive, onRefresh: function(){ if($el.find('.product-col').get(0)){ portoCalcSliderButtonsPosition($slider_wrapper, $el.find('.product-col').css('padding-left')); }}, onInitialized: function(){ if($el.find('.product-col').get(0)){ portoCalcSliderButtonsPosition($slider_wrapper, $el.find('.product-col').css('padding-left')); } if($el.find('.owl-item.cloned').length){ setTimeout(function(){ var ins=$el.find('.owl-item.cloned .porto-lazyload:not(.lazy-load-loaded)').themePluginLazyLoad({ effect: 'fadeIn', effect_speed: 400 }); if(ins&&ins.loadAndDestroy){ ins.loadAndDestroy(); }}, 100); }}, touchDrag:(count==1) ? false:true, mouseDrag:(count==1) ? false:true }); if(this.options.autoHeight){ var thisobj=this; $(window).on('resize', function(){ thisobj.calcOwlHeight($el); }); if(theme.isLoaded){ setTimeout(function(){ thisobj.calcOwlHeight($el); }, 100); }else{ $(window).on('load', function(){ thisobj.calcOwlHeight($el); }); }} $el.owlCarousel(this.options); return this; }}; $.extend(theme, { WooProductsSlider: WooProductsSlider }); $.fn.themeWooProductsSlider=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this; }else{ return new theme.WooProductsSlider($this, opts); }}); }}).apply(this, [window.theme, jQuery]); } (function(theme, $){ var $supports_html5_storage; try { $supports_html5_storage=('sessionStorage' in window&&window.sessionStorage!==null); window.sessionStorage.setItem('wc', 'test'); window.sessionStorage.removeItem('wc'); } catch(err){ $supports_html5_storage=false; } var setCartCreationTimestamp=function(){ if($supports_html5_storage){ sessionStorage.setItem('wc_cart_created',(new Date()).getTime()); }}; var setCartHash=function(cart_hash){ if($supports_html5_storage&&wc_cart_fragments_params){ localStorage.setItem(wc_cart_fragments_params.cart_hash_key, cart_hash); sessionStorage.setItem(wc_cart_fragments_params.cart_hash_key, cart_hash); }}; var initAjaxRemoveCartItem=function(){ $(document).off('click', '.widget_shopping_cart .remove-product, .shop_table.cart .remove-product').on('click', '.widget_shopping_cart .remove-product, .shop_table.cart .remove-product', function(e){ e.preventDefault(); var $this=$(this); var cart_id=$this.data("cart_id"); var product_id=$this.data("product_id"); $this.closest('li').find('.ajax-loading').show(); $.ajax({ type: 'POST', dataType: 'json', url: theme.ajax_url, data: { action: "porto_cart_item_remove", nonce: js_porto_vars.porto_nonce, cart_id: cart_id }, success: function(response){ var this_page=window.location.toString(), item_count=$(response.fragments['div.widget_shopping_cart_content']).find('.mini_cart_item').length; this_page=this_page.replace('add-to-cart', 'added-to-cart'); updateCartFragment(response); $(document.body).trigger('wc_fragments_refreshed'); $('.viewcart-' + product_id).removeClass('added'); $('.porto_cart_item_' + cart_id).remove(); if(item_count==0&&($('body').hasClass('woocommerce-cart')||$('body').hasClass('woocommerce-checkout'))){ $('.page-content').fadeTo(400, 0.8).block({ message: null, overlayCSS: { opacity: 0.2 }}); }else{ $('.shop_table.cart, .shop_table.review-order, .updating, .cart_totals').fadeTo(400, 0.8).block({ message: null, overlayCSS: { opacity: 0.2 }}); } $('.widget_shopping_cart, .updating').stop(true).css('opacity', '1').unblock(); if(item_count==0&&($('body').hasClass('woocommerce-cart')||$('body').hasClass('woocommerce-checkout'))){ $('.page-content').load(this_page + ' .page-content:eq(0) > *', function(){ $('.page-content').stop(true).css('opacity', '1').unblock(); }); }else{ $('.shop_table.cart').load(this_page + ' .shop_table.cart:eq(0) > *', function(){ $('.shop_table.cart').stop(true).css('opacity', '1').unblock(); }); $('.cart_totals').load(this_page + ' .cart_totals:eq(0) > *', function(){ $('.cart_totals').stop(true).css('opacity', '1').unblock(); }); $('.shop_table.review-order').load(this_page + ' .shop_table.review-order:eq(0) > *', function(){ $('.shop_table.review-order').stop(true).css('opacity', '1').unblock(); }); }} }); return false; }); }; var refreshCartFragment=function(){ initAjaxRemoveCartItem(); if($.cookie('woocommerce_items_in_cart') > 0){ $('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').show(); }else{ $('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').hide(); }}; var updateCartFragment=function(data){ if(data&&data.fragments){ var fragments=data.fragments, cart_hash=data.cart_hash; $.each(fragments, function(key, value){ $(key).replaceWith(value); }); if(typeof wc_cart_fragments_params==='undefined'){ return; } if($supports_html5_storage){ var prev_cart_hash=sessionStorage.getItem('wc_cart_hash'); if(prev_cart_hash===null||prev_cart_hash===undefined||prev_cart_hash===''){ setCartCreationTimestamp(); } sessionStorage.setItem(wc_cart_fragments_params.fragment_name, JSON.stringify(fragments)); setCartHash(cart_hash); }} }; $(function(){ refreshCartFragment(); $(document).on('click', '.add_to_cart_button', function(e){ var $this=$(this); if($this.is('.product_type_simple')){ if($this.attr('data-product_id')){ $this.addClass('product-adding'); } if($this.hasClass('viewcart-style-2')||$this.hasClass('viewcart-style-3')){ $('body').append('
'); if(!$(this).closest('.product').find('.loader-container').length){ $(this).closest('.product').find('.product-image').append('
'); } $(this).closest('.product').find('.loader-container').show(); }} }); $(document).on('click', 'span.add_to_cart_button', function(e){ var $this=$(this); if($this.is('.product_type_simple')){ if(!$this.attr('data-product_id')){ window.location.href=$this.attr('href'); }}else{ window.location.href=$this.attr('href'); }}); $('body').on('added_to_cart', function(){ $('ul.products li.product .added_to_cart, .porto-tb-item .added_to_cart').remove(); initAjaxRemoveCartItem(); }); $(document.body).on('wc_fragments_refreshed wc_fragments_loaded', function(){ refreshCartFragment(); }); $(document).on('click', '.product-image .viewcart, .after-loading-success-message .viewcart', function(e){ if(wc_add_to_cart_params.cart_url){ window.location.href=wc_add_to_cart_params.cart_url; } e.preventDefault(); }); var porto_product_add_cart_timer=null; $(document).on('added_to_cart', 'body', function(event){ var $mc_item=$('#mini-cart .cart-items'); if($mc_item.length){ $mc_item.addClass('count-updating'); setTimeout(function(){ $mc_item.removeClass('count-updating'); }, 1000); } $('body #loading-mask').remove(); $('.add_to_cart_button.product-adding').each(function(){ var $link=$(this); $link.removeClass('product-adding'); if($link.hasClass('viewcart-style-1')){ $link.closest('.product').find('.viewcart').addClass('added'); }else{ $link.closest('.product').find('.loader-container').hide(); if($link.closest('li.outofstock').length){ return; } var $msg; if($link.hasClass('viewcart-style-2')){ $msg=$('.after-loading-success-message .success-message-container').eq(0); $msg.find('.product-name').text($link.closest('.product').find('.woocommerce-loop-product__title').text()); }else{ $msg=$('.after-loading-success-message .success-message-container').last().clone().removeClass('d-none'); $msg.find('.product-name').empty().append($link.closest('.product').find('.product-loop-title, .post-title a').clone()); } $msg.find('.msg-box img').remove(); if($link.closest('.product').find('.product-image img').length){ var $img=$link.closest('.product').find('.product-image img').eq(0); $('').attr('src', $img.data('oi') ? $img.data('oi'):$img.attr('src')).appendTo($msg.find('.msg-box')); } $('.after-loading-success-message').eq(0).stop().show(); if($link.hasClass('viewcart-style-2')){ if(porto_product_add_cart_timer){ clearTimeout(porto_product_add_cart_timer); } porto_product_add_cart_timer=setTimeout(function(){ $('.after-loading-success-message').eq(0).hide(); }, 4000); }else{ $msg.prependTo('.after-loading-success-message'); theme.requestFrame(function(){ $msg.addClass('active'); }); setTimeout(function(){ $msg.find('.mfp-close').trigger('click'); }, 5000); }} }); }); $('.after-loading-success-message .continue_shopping').on('click', function(){ $('.after-loading-success-message').eq(0).fadeOut(200); }); $('.after-loading-success-message').on('click', '.mfp-close', function(){ var $obj=$(this).closest('.success-message-container'); $obj.removeClass('active'); theme.requestTimeout(function(){ $obj.slideUp(300, function(){ $obj.remove(); }); }, 350); }); $(document.body).on('click', '.variations_form .variations .filter-item-list .filter-color, .variations_form .variations .filter-item-list .filter-item', function(e){ e.preventDefault(); var $this=$(this), $selector=$this.closest('ul').siblings('select'); if(!$selector.length||$this.hasClass('disabled')){ return; } var $li_obj=$this.closest('li'); if($li_obj.hasClass('active')){ $li_obj.removeClass('active'); $selector.val(''); }else{ $li_obj.addClass('active').siblings().removeClass('active'); $selector.val($this.data('value')); } $selector.trigger('change.wc-variation-form'); }); $(document).on('wc_variation_form', '.variations_form', function(){ $(this).addClass('vf_init'); if($(this).find('.filter-item-list').length < 1){ return; } $(this).find('.variations select').trigger('focusin'); }); $(document).on('updated_wc_div', function(){ $('.woocommerce-cart-form .porto-lazyload').themePluginLazyLoad(); }); $(document).on('found_variation reset_data', '.variations_form', function(e, args){ var $this=$(this); if($this.find('.product-attr-description').length){ if(typeof args=='undefined'){ $this.find('.product-attr-description').removeClass('active'); }else{ $this.find('.product-attr-description').addClass('active'); $this.find('.product-attr-description .attr-desc').removeClass('active'); $this.find('.variations select').each(function(){ var $obj=$(this); $this.find('.product-attr-description .attr-desc[data-attrid="' + $obj.val() + '"]').addClass('active'); }); }} if($this.find(".filter-item-list").length < 1){ return; } $this.find(".filter-item-list").each(function(){ if($(this).next("select").length < 1){ return; } var selector=$(this).next("select"), $list=$(this); $list.find('li.active').removeClass('active'); $list.find('.filter-color, .filter-item').removeClass('enabled').removeClass('disabled'); selector.children("option").each(function(){ if(!$(this).val()){ return; } $list.find('[data-value="' + $(this).val() + '"]').addClass('enabled'); if($(this).val()==selector.val()){ $list.find('[data-value="' + $(this).val() + '"]').parent().addClass('active'); } /*html +=' a', function(e){ e.preventDefault(); $(this).next().stop().slideToggle(400); }); if($(document.body).hasClass('single-product')){ $(document).on('woocommerce_variation_has_changed', '.variations_form', function(e, variation){ $(document.body).removeClass('single-add-to-cart'); }); $(document).on('found_variation', '.variations_form', function(e, variation){ try { var cart_items=JSON.parse(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)); if(cart_items['div.widget_shopping_cart_content']){ var cart_item=$(cart_items['div.widget_shopping_cart_content']).find('.porto-variation-' + variation.variation_id); if(cart_item.length){ theme.requestFrame(function(){ $(document.body).addClass('single-add-to-cart'); }); }} } catch(e){ }}); }}); }).apply(this, [window.theme, jQuery]); (function(theme, $){ var expr=/[.#\w].([\S]*)/g, classexpr=/(?!(\[))(\.)[^.#[]*/g, idexpr=/(#)[^.#[]*/, tagexpr=/^[\w]+/, varexpr=/(\w+?)=(['"])([^\2$]*?)\2/, simpleselector=/^[\w]+$/, parseSelector=function(d){ for(var c={ sel: [], val: [] }, a=[], j = !1, h="", e=[], f=0, m=d.length; f < m; f++){ var g=d.charAt(f); if(j) if("\\"===g&&f + 1 < d.length) e.push(d.charAt(++f)); else if(h===g) h="", e.push(g); else if(( "'"===g||'"'===g)&&""===h) h=g, e.push(g); else if("]"===g&&""===h) c.val.push(e.join("")), e=[], j = !1; else { if("]"!==g||""!==h) ""===h&&","===g ?(c.val.push(e.join("")), e=[]):e.push(g) } else "\\"===g&&f + 1 < d.length ? j&&e.push(d.charAt(++f)):"["===g&&""===h ? j = !0:" "===g||"+"===g ?(c.sel=c.sel.join(""), a.push(c), "+"===g&&a.push({ sel: "+", val: "" }), c={ sel: [], val: [] }):" "!==g&&"]"!==g&&c.sel.push(g) } if(0!=c.sel.length||0!=c.val.length) c.sel=c.sel.join(""), a.push(c); for(f=0; f < a.length; f++){ c=a[f].sel; if("+"===c) b.tag=c; else { var b=[]; b.tag=tagexpr.exec(c); b.id=idexpr.exec(c); b.id&&Array.isArray(b.id)&&(b.id=b.id[0].substr(1)); b.tag||(b.tag="div"); b.vars=[]; for(d=0; d < a[f].val.length; d++)h = a[f].val[d].indexOf("="), j=a[f].val[d].substr(0, h), h=a[f].val[d].substr(h + 1), h=h.replace(/^[\s]*[\"\']*|[\"\']*[\s]*$/g, ""), "text"===j ? b.text=h:b.vars.push([j, h]); c=c.match(classexpr); j=[]; if(c){ for(d=0; d < c.length; d++)j.push(c[d].substr(1)); b.className=j.join(" ") }} a[f]=b } return a }, rmFromParent=function(d){ var c=d.parentNode, a=d.nextSibling; c.removeChild(d); return a ? function(){ c.insertBefore(d, a) }:function(){ c.appendChild(d) }}, nonArrVer=function(d, c){ var a=[], a=simpleselector.test(d) ? [ { tag: d } ]:parseSelector(d), j=[]; "undefined"===typeof c&&(c=1); for(var h=[], e=[], f=[], m=document.createElement("div"), g=0, b=0; b < a.length; b++){ if("+"==a[b].tag) e=f.slice(), --g; else { for(var l=0; l < c; l++){ var k; if("input"==a[b].tag){ k=[]; k.push("<" + a[b].tag); a[b].id&&k.push("id='" + a[b].id + "'"); a[b].className&&(k.push("class='" + a[b].className), b + 1===a.length&&k.push(lastClass), k.push("'")); if(a[b].vars) for(var n=0; n < a[b].vars.length; n++)k.push(a[b].vars[n][0] + "='" + a[b].vars[n][1] + "'"); a[b].text&&k.push("value='" + a[b].text + "'"); k.push("/>"); f[l]=e[l]; e[l] ?(e[l].innerHTML +=k.join(" "), e[l]=e[l].lastChild):(m.innerHTML=k.join(" "), e[l]=m.removeChild(m.firstChild)) }else{ k=document.createElement(a[b].tag); if(a[b].vars) for(var n=0; n < a[b].vars.length; n++)k.setAttribute(a[b].vars[n][0], a[b].vars[n][1]); a[b].id&&(k.id=a[b].id); a[b].className&&(k.className=a[b].className); a[b].text&&k.appendChild(document.createTextNode(a[b].text)); f[l]=e[l]; e[l]=e[l] ? e[l].appendChild(k):k }} g++||Array.prototype.push.apply(h, e); } j=$.merge(j, e); } return $(h) }, arrVer=function(d, c, a){ for(var j=d.match(/%[^%]*%/g)||[], h=[], e=0; e < c.length; e++){ for(var f=d, m=0; m < j.length; m++)var g=j[m].substr(1, j[m].length - 2), f=f.replace(j[m], c[e][g]); h=$.merge(h, nonArrVer(f, a)) } return $(h) }; $.porto_jseldom=function(d){ if(2==arguments.length&&$.isPlainObject(arguments[1])) return arrVer.apply(this, [arguments[0], [arguments[1]]]); if(1==arguments.length||2==arguments.length&&!Array.isArray(arguments[1])) return nonArrVer.apply(this, arguments); if(2==arguments.length) return arrVer.apply(this, arguments) }; var refreshPriceSlider=function(){ var $price_slider=$('.price_slider'); if($price_slider.length){ if(typeof woocommerce_price_slider_params==='undefined'){ return false; } $('input#min_price, input#max_price').hide(); $('.price_slider, .price_label').show(); var min_price=$('.price_slider_amount #min_price').data('min'), max_price=$('.price_slider_amount #max_price').data('max'), current_min_price=parseInt($('.price_slider_amount #min_price').val() ? $('.price_slider_amount #min_price').val():min_price, 10), current_max_price=parseInt($('.price_slider_amount #max_price').val() ? $('.price_slider_amount #max_price').val():max_price, 10); $('.price_slider').slider({ range: true, animate: true, min: min_price, max: max_price, values: [current_min_price, current_max_price], create: function(){ $('.price_slider_amount #min_price').val(current_min_price); $('.price_slider_amount #max_price').val(current_max_price); $(document.body).trigger('price_slider_create', [current_min_price, current_max_price]); }, slide: function(event, ui){ $('input#min_price').val(ui.values[0]); $('input#max_price').val(ui.values[1]); $(document.body).trigger('price_slider_slide', [ui.values[0], ui.values[1]]); }, change: function(event, ui){ $(document.body).trigger('price_slider_change', [ui.values[0], ui.values[1]]); }}); } $('.yith-woo-ajax-navigation, .yith-wcan-list-price-filter').removeClass('loading'); }; var categoryAjaxProcess=function(href, updateSelect2, updateStyle){ if('undefined'!=typeof window.parent&&'undefined'!=typeof window.parent.vc){ return; } var shop_before='.shop-loop-before', $shop_before=$(shop_before), shop_after='.shop-loop-after:not(.is-shortcode)', shop_container='.archive-products .products:not(.is-shortcode)', shop_info='.archive-products .woocommerce-info', $shop_parent=$shop_before.parent(), $shop_container=$(shop_container), $sticky_sidebar=$('.sidebar [data-plugin-sticky]'), show_toolbar=$shop_before.data('show'), horizontal_filter='.porto-product-filters:not(.style2)'; if(show_toolbar) $(shop_before + ',' + shop_after).stop(true).fadeTo(400, 1).block({ message: null, overlayCSS: { opacity: 0.2 }}); if(js_porto_vars.use_skeleton_screen.indexOf('shop')==-1){ if($shop_container.length){ $shop_container.addClass('yith-wcan-loading'); if(!$shop_container.children('.porto-loading-icon').length){ $shop_container.append(''); }}else{ $(shop_info).html('').addClass('yith-wcan-loading products'); if(!$(shop_info).children('.porto-loading-icon').length){ $(shop_info).append(''); }} }else{ if($shop_container.length){ $shop_container.addClass('skeleton-body'); var lg_cols, other_col_cls=$shop_container.data(( $shop_container.hasClass('list') ? 'list':'grid') + '_col_cls'); if($shop_container.hasClass('list')&&!other_col_cls){ lg_cols=4; }else{ for(var i=1; i <=8; i++){ if($shop_container.hasClass('pcols-lg-' + i)){ lg_cols=i; break; }} if(!lg_cols){ if($shop_container.hasClass('has-ccols')){ var clses; if(other_col_cls){ clses=$shop_container.attr('class').split(' '); var new_cls=[]; for(var i=0; i < clses.length; i++){ if(0!==clses[i].indexOf('ccols-')&&'has-ccols'!=clses[i]){ new_cls.push(clses[i]); }} $shop_container.attr('class', new_cls.join(' ') + ' ' + other_col_cls); clses=other_col_cls.split(' '); }else{ clses=$shop_container.attr('class').split(' '); } for(var i=0; i < clses.length; i++){ if(0===clses[i].indexOf('ccols-')){ lg_cols=clses[i].replace(/ccols-[sm|md|lg|xl|xxl]*[-]*([\d])/, '$1'); break; }} }} } if(lg_cols){ var product_class='product product-col'; $shop_container.empty(); if($shop_container.data('product_layout')){ product_class +=' ' + escape($shop_container.data('product_layout')); } for(var i=0; i < lg_cols * 3; i++){ $shop_container.append('
  • '); }}else{ $shop_container.find('.product-col').empty(); } if($shop_container.hasClass('owl-loaded')){ $shop_container.removeClass('owl-loaded'); }} } if($(horizontal_filter).length){ $(horizontal_filter).block({ message: null, overlayCSS: { opacity: 0.2 }}); } if($sticky_sidebar.get(0)){ theme.refreshStickySidebar(false); } theme.scrolltoContainer(show_toolbar ?($shop_before.hasClass('sticky')&&$shop_before.prev('.filter-placeholder').length ? $shop_before.prev('.filter-placeholder'):$shop_before):$shop_container); $('.yith-woo-ajax-navigation, .yith-wcan-list-price-filter').addClass('loading'); var cart_content, widget_cart; if(widget_cart=$('.sidebar-content .widget_shopping_cart').get(0)){ cart_content=$(widget_cart).html(); } $.ajax({ url: href, data: { portoajax: true, load_posts_only: true }, type: "POST", success: function(response){ var $parent=$shop_container.parent(), $response=$(response); if($sticky_sidebar.get(0)) $shop_parent.css('min-height', 0); var $response_container=$response.find(shop_container); if($response_container.length){ if($shop_container.length&&$shop_container.data('infinitescroll')){ try { $shop_container.data('infinitescroll').destroy(); var ins=$shop_container.data('__postsinfinite'); if(ins){ ins.destroy(); }} catch(e){ }} if(typeof updateStyle!='undefined'&&updateStyle&&$parent.hasClass('porto-posts-grid')){ var old_style=$shop_container.siblings('style'), new_style=$response_container.siblings('style'); if(old_style.length&&new_style.length){ old_style.replaceWith(new_style); }} $shop_container.replaceWith($response_container[0].outerHTML); $shop_container=$(shop_container); }else if($parent.hasClass('porto-posts-grid')){ $shop_container.empty(); }else{ $parent.html($response.find('.woocommerce-info')); $parent.find('.woocommerce-info').addClass('products'); } if($(shop_before + ',' + shop_after).get(0)) $(shop_before + ',' + shop_after).stop(true).css('opacity', '1').unblock(); if($response.find(shop_before).length){ if($(shop_before).length==0){ $.porto_jseldom(shop_before).insertBefore($(shop_container)); } $(shop_before).each(function(index){ var $res_shop_before=$response.find(shop_before).eq(index); if($res_shop_before.length){ $(this).html($res_shop_before.html()).show(); }}); }else{ $(shop_before).empty(); } porto_woocommerce_variations_init($parent); if($response.find(horizontal_filter).length){ $(horizontal_filter).html($response.find(horizontal_filter).html()); } $(horizontal_filter).unblock(); if($response.find(shop_after).length){ if($(shop_after).length==0){ $.porto_jseldom(shop_after).insertAfter($(shop_container)); } $(shop_after).html($response.find(shop_after).html()).show(); }else{ if($(shop_after).length==0&&$response.find('.woocommerce-pagination').length){ var $responsePg=$response.find('.woocommerce-pagination'); $('.content-area#primary .woocommerce-pagination').each(function(index){ var $responseContent=$responsePg.eq(index); if($responseContent.length){ $(this).html($responseContent.html()); }}); }else{ $(shop_after).empty(); }} var $pagination=$parent.children('.pagination-wrap'), $newPagination=$response_container.siblings('.pagination-wrap'); if($pagination.length){ $pagination[0].outerHTML=$newPagination.length ? $newPagination[0].outerHTML:''; }else{ $newPagination.length&&$parent.append($newPagination); } var $count=$('.woocommerce-result-count'); if($count.length){ var $newCount=$response.find('.woocommerce-result-count').eq(0); $count[0].outerHTML=$newCount.length ? $newCount[0].outerHTML:''; } if($parent.hasClass('porto-posts-grid')){ if($parent.is('.porto-ajax-load.load-infinite, .porto-ajax-load.load-more')){ $parent.portoInfiniteScroll(); }}else if(typeof theme.PostsInfinite!=='undefined'&&typeof porto_infinite_scroll!=='undefined'){ new theme.PostsInfinite($(shop_container)); } $('.sidebar-content').each(function(index){ var $this=$(this), $that=$($response.find('.sidebar-content').get(index)); $this.html($that.html()); if(typeof updateSelect2!='undefined'&&updateSelect2){ if(jQuery().selectWoo){ var porto_wc_layered_nav_select=function(){ $this.find('select.woocommerce-widget-layered-nav-dropdown').each(function(){ $(this).selectWoo({ placeholder: $(this).find('option').eq(0).text(), minimumResultsForSearch: 5, width: '100%', allowClear: typeof $(this).attr('multiple')!='undefined'&&$(this).attr('multiple')=='multiple' ? 'false':'true' }); }); }; porto_wc_layered_nav_select(); } $('body').children('span.select2-container').remove(); }}); var $sidebar_menu=$('.sidebar-content .sidebar-menu:not(.side-menu-accordion)'); if($sidebar_menu.length){ theme.SidebarMenu.build($sidebar_menu); } var $script=$response.filter('script:contains("var woocommerce_price_slider_params")').first(); if($script&&$script.length&&$script.text().indexOf('{')!==-1&&$script.text().indexOf('}')!==-1){ var arrStr=$script.text().substring($script.text().indexOf('{'), $script.text().indexOf('}') + 1); window.woocommerce_price_slider_params=JSON.parse(arrStr); } if(!navigator.userAgent.match(/msie/i)){ window.history.pushState({ "pageTitle": response.pageTitle }, "", href); } if($parent.hasClass('yit-wcan-container')){ $parent.parent().removeClass('porto-ajax-loading'); }else{ $parent.removeClass('porto-ajax-loading'); } $(document).trigger("yith-wcan-ajax-filtered"); if(widget_cart=$('.sidebar-content .widget_shopping_cart').get(0)){ $('.sidebar-content .widget_shopping_cart').html(cart_content); if($.cookie('woocommerce_items_in_cart') > 0){ $('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').show(); }else{ $('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').hide(); }} if(( 'undefined'!==typeof yith_wcwl_l10n)&&yith_wcwl_l10n.enable_ajax_loading){ $parent.trigger('yith_wcwl_reload_fragments'); } $(document.body).trigger('porto_init_countdown', [$parent]); }}); }; function porto_update_url_param(uri, key, value){ var re=new RegExp("([?&])" + key + "=.*?(&|$)", "i"); var separator=uri.indexOf('?')!==-1 ? "&":"?"; if(uri.match(re)){ return uri.replace(re, '$1' + key + "=" + value + '$2'); }else{ return uri + separator + key + "=" + value; }} var categoryAjax=function(){ $('.widget_price_filter').addClass('yith-wcan-list-price-filter'); if(theme.category_ajax){ $('.woocommerce-ordering').off('change', 'select.orderby').on('change', 'select.orderby', function(e){ e.preventDefault(); var $this=$(this), $form=$this.closest('form'), href='?' + $form.serialize(); categoryAjaxProcess(href); }); $('.woocommerce-viewing').off('change', 'select.count').on('change', 'select.count', function(e){ e.preventDefault(); var $this=$(this), $form=$this.closest('form'), href='?' + $form.serialize(); categoryAjaxProcess(href); }); $('.woocommerce-pagination:not(.load-more)').each(function(){ if($(this).closest('.porto-products').length||$(this).closest('#comments').length){ return; } $(this).off('click', 'a.page-numbers').on('click', 'a.page-numbers', function(e){ e.preventDefault(); var href=this.href; categoryAjaxProcess(href); }); }); $(document).off('click', '.yith-wcan a').on('click', '.yith-wcan a', function(e){ $(this).yith_wcan_ajax_filters(e, this); }); $('.widget_price_filter .price_slider_wrapper').off('click', '.button').on('click', '.button', function(e){ e.preventDefault(); var $this=$(this), $form=$this.closest('form'), action=$form.attr('action'), href=action +(-1===action.indexOf('?') ? '?':'&') + $form.serialize(), $count=$('.woocommerce-viewing select.count'); if($count.length){ var count=$('.woocommerce-viewing select.count').val(); if(count!=$count.find('option:not([disabled]):first').val()){ href +='&count=' + count; }} $('.widget_price_filter').removeClass('yith-wcan-list-price-filter'); categoryAjaxProcess(href); }); $('.porto_widget_price_filter').off('click', '.button').on('click', '.button', function(e){ e.preventDefault(); var $this=$(this), $form=$this.closest('form'), action=$form.attr('action'), $count=$('.woocommerce-viewing select.count'), hrefArr=$form.serializeArray(), href=action; $.each(hrefArr, function(i, field){ if($.trim(field.value)){ if(action.indexOf('?')==-1&&href==action){ href +='?'; }else{ href +='&'; } href +=(field.name + "=" + $.trim(field.value)); }}); if($count.length){ var count=$('.woocommerce-viewing select.count').val(); if(count!=$count.find('option:not([disabled]):first').val()){ if(href.indexOf('?')==-1){ href +='?count=' + count; }else{ href +='&count=' + count; }} } categoryAjaxProcess(href); }); $('.widget_layered_nav, .widget_rating_filter, .widget_layered_nav_filters').off('click', 'a').on('click', 'a', function(e){ if($(this).hasClass('yit-wcan-select-open')) return; e.preventDefault(); var $this=$(this), href=$this.attr('href'), $count=$('.woocommerce-viewing select.count'); if($this.hasClass('yith-wcan-reset-navigation')&&!$('.archive-products .products:not(.is-shortcode)').length){ window.location.href=href; return false; } if($count.length){ var count=$('.woocommerce-viewing select.count').val(); if(count!=$count.find('option:not([disabled]):first').val()){ href=porto_update_url_param(href, 'count', count); }} var yith_select=$this.closest('.yith-wcan-select'); if(yith_select.get(0)){ yith_select.parent().css({ "opacity": 0, "z-index": -1 }); } categoryAjaxProcess(href); return false; }); $('.widget_layered_nav select').off('change').on('change', function(e){ e.preventDefault(); var $this=$(this), name=$this.closest('form').find('input[type=hidden]').length ? $this.closest('form').find('input[type=hidden]').attr('name').replace('filter_', ''):$this.attr('class').replace('dropdown_layered_nav_', ''), slug=$this.val(), href, $count=$('.woocommerce-viewing select.count'); href=window.location.href; href=href.replace(/\/page\/\d+/, "").replace("&", '&').replace("%2C", ','); href=porto_update_url_param(href, 'filtering', '1'); href=porto_update_url_param(href, 'filter_' + name, slug); if($count.length){ var count=$('.woocommerce-viewing select.count').val(); if(count!=$count.find('option:not([disabled]):first').val()){ href=porto_update_url_param(href, 'count', count); }} categoryAjaxProcess(href, name); return false; }); }else{ $(document).on('change', '.woocommerce-viewing select.count', function(){ $(this).closest('form').trigger('submit'); }); }}; var ajaxFiltered=function(initLoad){ var shop_before='.shop-loop-before', shop_after='.shop-loop-after', shop_container='.archive-products .products', $shop_before=$(shop_before), $shop_parent=$shop_before.parent(), $shop_toolbox=$(shop_before + ',' + shop_after), $sticky_sidebar=$('.sidebar [data-plugin-sticky]'); if($sticky_sidebar.get(0)){ $shop_parent.css('min-height', 0); } if($shop_toolbox.length){ $shop_toolbox.stop(true).fadeTo(400, 1).unblock(); } if($(shop_container).find('.product').length||$(shop_after).closest('.porto-products').length||$shop_before.hasClass('shop-builder')){ $shop_toolbox.show().data('show', true); }else{ $shop_toolbox.hide().data('show', false); if($shop_before.find('.porto-product-filters.style2').length){ $shop_before.show().data('show', true); }} if(typeof initLoad=='undefined'||!initLoad){ porto_init(); porto_woocommerce_init(); } $('.woocommerce-ordering').off('change', 'select.orderby').on('change', 'select.orderby', function(){ $(this).closest('form').trigger('submit'); }); refreshPriceSlider(); categoryAjax(); }; var skeletonLoadingTrigger; $('.skeleton-loading').on('skeleton-loaded', function(){ var $this=$(this); if(skeletonLoadingTrigger){ theme.deleteTimeout(skeletonLoadingTrigger); } porto_woocommerce_variations_init($this); if($this.hasClass('products')||$this.hasClass('product')){ $(document).trigger('yith_infs_added_elem'); } skeletonLoadingTrigger=theme.requestTimeout(function(){ porto_woocommerce_init(); refreshPriceSlider(); if($('body').hasClass('single-product')){ theme.WooVariationForm.init(); var $image_slider=$('.product-image-slider'); if($image_slider.length&&$image_slider.data('owl.carousel')){ $image_slider.trigger('refresh.owl.carousel'); }else{ theme.WooProductImageSlider.initialize(); } $('.wc-tabs-wrapper, .woocommerce-tabs, #rating').trigger('init'); if($(document.body).hasClass('yith-booking')){ $(document).trigger('yith-wcbk-init-booking-form'); }} if($this.find('.widget_shopping_cart_content').length){ $(document.body).trigger('wc_fragment_refresh'); }}, 100); }); $(function(){ if(typeof yith_wcan!='undefined'){ yith_wcan.container='.archive-products .products'; yith_wcan.pagination='.shop-loop-before'; yith_wcan.result_count='.shop-loop-after'; } $(document).on('click', '.yith-wcan a', function(e){ var shop_before='.shop-loop-before', $shop_before=$(shop_before), shop_after='.shop-loop-after', shop_container='.archive-products .products', shop_info='.archive-products .woocommerce-info', $sticky_sidebar=$('.sidebar [data-plugin-sticky]'), show_toolbar=$shop_before.data('show'); if(show_toolbar) $(shop_before + ',' + shop_after).stop(true).show().fadeTo(400, 0.8).block({ message: null, overlayCSS: { opacity: 0.2 }}); if($(shop_container).length){ $(shop_container).html('').addClass('yith-wcan-loading'); if(!$(shop_container).children('.porto-loading-icon').length){ $(shop_container).append(''); }}else{ $(shop_info).html('').addClass('yith-wcan-loading products'); if(!$(shop_info).children('.porto-loading-icon').length){ $(shop_info).append(''); }} if($sticky_sidebar.get(0)){ theme.refreshStickySidebar(false); } $('.yith-woo-ajax-navigation, .yith-wcan-list-price-filter').addClass('loading'); theme.scrolltoContainer(show_toolbar ?($shop_before.hasClass('sticky')&&$shop_before.prev('.filter-placeholder').length ? $shop_before.prev('.filter-placeholder'):$shop_before):$(shop_container)); }); $(document).ready(function(){ ajaxFiltered(true); }); $(document).on('yith-wcan-ajax-filtered', function(){ ajaxFiltered(); }); if(theme.prdctfltr_ajax){ $(document).on('change', '.woocommerce-viewing select.count', function(){ $(this).closest('form').trigger('submit'); }); $(document).on('click', '.woocommerce-pagination:not(.load-more) a.page-numbers', function(e){ var $shop_before=$('.shop-loop-before'); theme.scrolltoContainer($shop_before.hasClass('sticky')&&$shop_before.prev('.filter-placeholder').length ? $shop_before.prev('.filter-placeholder'):$shop_before); }); } $(document).on('click', '.gridlist-toggle #grid, .gridlist-toggle #list', function(e){ e.preventDefault(); var $this=$(this); if($this.hasClass('active')){ return false; } $('.gridlist-toggle #grid, .gridlist-toggle #list').removeClass('active'); $this.addClass('active'); if($.cookie){ $.cookie('gridcookie', $this.attr('id'), { path: '/' }); } if(theme.category_ajax){ if(js_porto_vars.use_skeleton_screen.indexOf('shop')!=-1){ $('.archive-products ul.products, .archive-products .products-container').removeClass('grid').removeClass('list').addClass($this.attr('id')); }else{ $('.archive-products').addClass('porto-ajax-loading'); } categoryAjaxProcess(window.location.href, undefined, true); }else{ location.reload(); } return false; }); }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var duration=300, flag=false; $.extend(theme, { WooProductImageSlider: { defaults: { elements: '.product-image-slider' }, initialize: function($elements){ if(!$.fn.owlCarousel) return false; this.$elements=($elements||$(this.defaults.elements)); if(!this.$elements.length&&!$('.product-images-block').length){ return this; } this.build(); return this; }, build: function(){ var self=this, thumbs_count=theme.product_thumbs_count; if(theme.product_zoom&&(!('ontouchstart' in document)||(( 'ontouchstart' in document)&&theme.product_zoom_mobile))){ var zoomConfig={ responsive: true, zoomWindowFadeIn: 200, zoomWindowFadeOut: 100, zoomType: js_porto_vars.zoom_type, cursor: 'grab' }; if(js_porto_vars.zoom_type=='lens'){ zoomConfig.scrollZoom=js_porto_vars.zoom_scroll; zoomConfig.lensSize=js_porto_vars.zoom_lens_size; zoomConfig.lensShape=js_porto_vars.zoom_lens_shape; zoomConfig.containLensZoom=js_porto_vars.zoom_contain_lens; zoomConfig.lensBorderSize=js_porto_vars.zoom_lens_border; zoomConfig.borderColour=js_porto_vars.zoom_border_color; } if(js_porto_vars.zoom_type=='inner'){ zoomConfig.borderSize=0; }else{ zoomConfig.borderSize=js_porto_vars.zoom_border; } if(!self.$elements.length){ var $images_grid=$('.product-images-block'); if($images_grid.length){ $images_grid.find('img').each(function(){ var $this=$(this); zoomConfig.zoomContainer=$this.parent(); if($.fn.elevateZoom){ $this.elevateZoom(zoomConfig); }else{ setTimeout(function(){ if($.fn.elevateZoom){ $this.elevateZoom(zoomConfig); }}, 1000); }}); }} } self.$elements.each(function(){ var $this=$(this), $product=$this.closest('.product'); if(!$product.length){ $product=$this.closest('.product_layout, .product-layout-image').eq(0); } var $thumbs_slider=$product.find('.product-thumbs-slider'), $thumbs=$product.find('.product-thumbnails-inner'), $thumbs_vertical_slider=$product.find('.product-thumbs-vertical-slider'), currentSlide=0, count=$this.find('> *').length; $this.find('> *:first-child').imagesLoaded(function(){ $thumbs_slider.owlCarousel({ rtl: theme.rtl, loop: false, autoplay: false, items: thumbs_count, nav: false, navText: ["", ""], dots: false, rewind: true, margin: 8, stagePadding: 1, lazyLoad: true, onInitialized: function(){ self.selectThumb(null, $thumbs_slider, 0); if($thumbs_slider.find('.owl-item').length >=thumbs_count) $thumbs_slider.append('
    '); }}).on('click', '.owl-item', function(){ self.selectThumb($this, $thumbs_slider, $(this).index()); }); if($thumbs_vertical_slider.length > 0&&typeof $.fn.slick=='function'){ $thumbs_vertical_slider.slick({ dots: false, vertical: true, slidesToShow: thumbs_count > 2 ? thumbs_count - 1:thumbs_count, slidesToScroll: 1 }).on('click', '.img-thumbnail', function(){ self.selectVerticalSliderThumb($this, $thumbs_vertical_slider, $(this).data('slick-index')); }); self.selectVerticalSliderThumb(null, $thumbs_vertical_slider, 0); if($thumbs_vertical_slider.find('.porto-lazyload').length){ theme.requestTimeout(function(){ $thumbs_vertical_slider.find('.slick-cloned .porto-lazyload:not(.lazy-load-loaded)').each(function(){ $(this).attr('src', $(this).data('oi')).removeAttr('data-oi').addClass('lazy-load-loaded'); }); }, 100); }} self.selectVerticalThumb(null, $thumbs, 0); $thumbs.off('click', '.img-thumbnail').on('click', '.img-thumbnail', function(){ self.selectVerticalThumb($this, $thumbs, $(this).index()); }); $thumbs_slider.off('click', '.thumb-prev').on('click', '.thumb-prev', function(e){ var currentThumb=$thumbs_slider.data('currentThumb'); self.selectThumb($this, $thumbs_slider, --currentThumb); }); $thumbs_slider.off('click', '.thumb-next').on('click', '.thumb-next', function(e){ var currentThumb=$thumbs_slider.data('currentThumb'); self.selectThumb($this, $thumbs_slider, ++currentThumb); }); var links=[]; if(theme.product_image_popup){ var i=0; $this.find('img').each(function(){ var slide={}; slide.src=$(this).attr('href'); slide.title=$(this).attr('alt'); links[i]=slide; i++; }); } var itemsCount=typeof $this.data('items')!='undefined' ? $this.data('items'):1, itemsResponsive=typeof $this.data('responsive')!='undefined' ? $this.data('responsive'):{}, centerItem=typeof $this.data('centeritem')!='undefined' ? true:false; for(var itemCount in itemsResponsive){ itemsResponsive[itemCount]={ items: itemsResponsive[itemCount] };} $this.owlCarousel({ rtl: theme.rtl, loop:(count > 1) ? true:false, autoplay: false, items: itemsCount, responsive: itemsResponsive, autoHeight: true, nav: true, navText: ["", ""], dots: false, rewind: true, lazyLoad: true, center: centerItem, onInitialized: function(){ if($this.find('.owl-item.cloned').length){ setTimeout(function(){ var ins=$this.find('.owl-item.cloned .porto-lazyload:not(.lazy-load-loaded)').themePluginLazyLoad({ effect: 'fadeIn', effect_speed: 400 }); if(ins&&ins.loadAndDestroy){ ins.loadAndDestroy(); }}, 100); } if(theme.product_zoom&&(!('ontouchstart' in document)||(( 'ontouchstart' in document)&&theme.product_zoom_mobile))){ $this.find('img').each(function(){ var $this=$(this); zoomConfig.zoomContainer=$this.parent(); if($.fn.elevateZoom){ $this.elevateZoom(zoomConfig); }else{ setTimeout(function(){ if($.fn.elevateZoom){ $this.elevateZoom(zoomConfig); }}, 1000); }}); }}, onTranslate: function(event){ currentSlide=event.item.index - $this.find('.cloned').length / 2; currentSlide=(currentSlide + event.item.count) % event.item.count; self.selectThumb(null, $thumbs_slider, currentSlide); self.selectVerticalThumb(null, $thumbs, currentSlide); self.selectVerticalSliderThumb(null, $thumbs_vertical_slider, currentSlide); }, onRefreshed: function(){ if(theme.product_zoom&&(!('ontouchstart' in document)||(( 'ontouchstart' in document)&&theme.product_zoom_mobile))){ $this.find('img').each(function(){ var $this=$(this), src=typeof $this.attr('href')!='undefined' ? $this.attr('href'):($this.data('oi') ? $this.data('oi'):$this.attr('src')), elevateZoom=$this.data('elevateZoom'), smallImage=$this.data('src') ? $this.data('src'):($this.data('oi') ? $this.data('oi'):$this.attr('src')); if(typeof elevateZoom!='undefined'){ elevateZoom.startZoom(); elevateZoom.swaptheimage(smallImage, src); }else if($.fn.elevateZoom){ zoomConfig.zoomContainer=$this.parent(); $this.elevateZoom(zoomConfig); }}); }} }); $this.data('links', links); if(theme.product_image_popup){ var $zoom_buttons=$this.next(); $zoom_buttons.off('click').on('click', function(e){ e.preventDefault(); if($.fn.magnificPopup){ $.magnificPopup.close(); $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { items: $this.data('links'), gallery: { enabled: true }, type: 'image' }), currentSlide); }}); }}); }); return self; }, selectThumb: function($image_slider, $thumbs_slider, index){ if(flag||!$thumbs_slider.length) return; flag=true; var len=$thumbs_slider.find('.owl-item').length, actives=[], i=0; index=(index + len) % len; if($image_slider){ $image_slider.trigger('to.owl.carousel', [index, duration, true]); } $thumbs_slider.find('.owl-item').removeClass('selected'); $thumbs_slider.find('.owl-item:eq(' + index + ')').addClass('selected'); $thumbs_slider.data('currentThumb', index); $thumbs_slider.find('.owl-item.active').each(function(){ actives[i++]=$(this).index(); }); if($.inArray(index, actives)==-1){ if(Math.abs(index - actives[0]) > Math.abs(index - actives[actives.length - 1])){ $thumbs_slider.trigger('to.owl.carousel', [(index - actives.length + 1) % len, duration, true]); }else{ $thumbs_slider.trigger('to.owl.carousel', [index % len, duration, true]); }} flag=false; }, selectVerticalSliderThumb: function($image_slider, $thumbs_vertical_slider, index){ if(flag||!$thumbs_vertical_slider.length) return; flag=true; var len=$thumbs_vertical_slider[0].slick.slideCount, actives=[], i=0; index=(index + len) % len; if($image_slider){ $image_slider.trigger('to.owl.carousel', [index, duration, true]); } $thumbs_vertical_slider.find('.img-thumbnail').removeClass('selected'); $thumbs_vertical_slider.find('.img-thumbnail:eq(' + index + ')').addClass('selected'); $thumbs_vertical_slider.data('currentThumb', index); $thumbs_vertical_slider.find('.img-thumbnail.slick-active').each(function(){ actives[i++]=$(this).index(); }); if($.inArray(index, actives)==-1){ if(Math.abs(index - actives[0]) > Math.abs(index - actives[actives.length - 1])){ $thumbs_vertical_slider.get(0).slick.goTo(( index - actives.length + 1) % len, false); }else{ $thumbs_vertical_slider.get(0).slick.goTo(index % len, false); }} flag=false; }, selectVerticalThumb: function($image_slider, $thumbs, index){ if(flag||!$thumbs.length) return; flag=true; var len=$thumbs.find('.img-thumbnail').length, i=0; index=(index + len) % len; if($image_slider){ $image_slider.trigger('to.owl.carousel', [index, duration, true]); } $thumbs.find('.img-thumbnail').removeClass('selected'); $thumbs.find('.img-thumbnail:eq(' + index + ')').addClass('selected'); $thumbs.data('currentThumb', index); flag=false; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; $.extend(theme, { WooQuickView: { initialize: function(){ this.events(); return this; }, events: function(){ var self=this; $(document).on('click', '.quickview', function(e){ e.preventDefault(); if(!$.fn.elevateZoom&&!$('#porto-script-jquery-elevatezoom').length){ var js=document.createElement('script'); js.id='porto-script-jquery-elevatezoom'; $(js).appendTo('body').attr('src', js_porto_vars.ajax_loader_url.replace('/images/ajax-loader@2x.gif', '/js/libs/jquery.elevatezoom.min.js')); } var $this=$(this), pid=$this.attr('data-id'); function init_quick_view_window(){ var args={ href: theme.ajax_url, ajax: { data: { action: 'porto_product_quickview', variation_flag: typeof wc_add_to_cart_variation_params!=='undefined', pid: pid, nonce: js_porto_vars.porto_nonce }}, type: 'ajax', helpers: { overlay: { locked: true, fixed: true }}, tpl: { error: '

    ' + theme.request_error + '

    ', closeBtn: '', next: '', prev: '' }, autoSize: true, autoWidth: true, afterShow: function(flag){ theme.requestTimeout(function(){ if(typeof flag=='undefined'||flag){ porto_woocommerce_init(); } theme.WooProductImageSlider.initialize($('.quickview-wrap-' + pid).find('.product-image-slider')); if($(document.body).hasClass('yith-booking')){ $(document).trigger('yith-wcbk-init-booking-form'); } var form_variation=$('.quickview-wrap-' + pid).find('form.variations_form'); if(form_variation.length > 0){ form_variation.wc_variation_form(); } $(document.body).trigger('porto_init_countdown', [$('.quickview-wrap-' + pid)]); if(( 'undefined'!==typeof yith_wcwl_l10n)&&yith_wcwl_l10n.enable_ajax_loading){ if($('.fancybox-opened .wishlist-fragment').length){ var options={}, $product=$('.fancybox-opened .wishlist-fragment'), id=$product.attr('class').split(' ').filter(( val)=> { return val.length&&val!=='exists'; }).join(yith_wcwl_l10n.fragments_index_glue); options[id]=$product.data('fragment-options'); if(!options){ return; } var ajaxData={ action: yith_wcwl_l10n.actions.load_fragments, context: 'frontend', fragments: options }; if(typeof yith_wcwl_l10n.nonce!='undefined'){ ajaxData.nonce=yith_wcwl_l10n.nonce.load_fragments_nonce; } $.ajax({ ajaxData, method: 'post', success: function(data){ if(typeof data.fragments!=='undefined'){ $.each(data.fragments, function(i, v){ var itemSelector='.' + i.split(yith_wcwl_l10n.fragments_index_glue).filter(( val)=> { return val.length&&val!=='exists'&&val!=='with-count'; }).join('.'), toReplace=$(itemSelector); var replaceWith=$(v).filter(itemSelector); if(!replaceWith.length){ replaceWith=$(v).find(itemSelector); } if(toReplace.length&&replaceWith.length){ toReplace.replaceWith(replaceWith); }}); }}, url: yith_wcwl_l10n.ajax_url }); }} }, 200); }, onUpdate: function(){ theme.requestTimeout(function(){ if(js_porto_vars.use_skeleton_screen.indexOf('quickview')==-1||!js_porto_vars.quickview_skeleton){ porto_woocommerce_init(); } var $slider=$('.quickview-wrap-' + pid).find('.product-image-slider'); if(typeof $slider.data('owl.carousel')!='undefined'&&typeof $slider.data('owl.carousel')._invalidated!='undefined') $slider.data('owl.carousel')._invalidated.width=true; $slider.trigger('refresh.owl.carousel'); $(document.body).trigger('porto_init_countdown', [$('.quickview-wrap-' + pid)]); }, 300); }}; if(js_porto_vars.use_skeleton_screen.indexOf('quickview')!=-1&&js_porto_vars.quickview_skeleton){ delete args['href']; delete args['ajax']; args['type']='inline'; $.fancybox.open(js_porto_vars.quickview_skeleton, args ); $.ajax({ url: theme.ajax_url, type: 'post', dataType: 'html', data: { action: 'porto_product_quickview', variation_flag: typeof wc_add_to_cart_variation_params!=='undefined', pid: pid, nonce: js_porto_vars.porto_nonce }, success: function(res){ var $res=$(res); $res.imagesLoaded(function(){ $('.skeleton-body.product').replaceWith($res); theme.WooQtyField.initialize(); $(window).trigger('resize'); args['afterShow'].call(false); }); }}); }else{ $.fancybox(args); }} if($.fn.fancybox){ init_quick_view_window(); }else if(!$('#porto-script-jquery-fancybox').length){ var js1=document.createElement('script'); js1.id='porto-script-jquery-fancybox'; $(js1).appendTo('body').on('load', function(){ init_quick_view_window(); }).attr('src', js_porto_vars.ajax_loader_url.replace('/images/ajax-loader@2x.gif', '/js/libs/jquery.fancybox.min.js')); } return false; }); if(typeof wc_add_to_cart_params!='undefined'){ $(document.body).on('click', '.single-product .single_add_to_cart_button:not(.disabled)', function(e){ if($(this).closest('.single-product').hasClass('product-type-external')||$(this).closest('.single-product').hasClass('product-type-grouped')){ return true; } e.preventDefault(); var $button=$(this), product_id=$button.val(), variation_id=$button.closest('form').find('input[name="variation_id"]').val(), quantity=$button.closest('form').find('input[name="quantity"]').val(); if($button.hasClass('loading')){ return false; } $button.removeClass('added'); $button.addClass('loading'); $button.parent().addClass('porto-ajax-loading'); if(!$button.siblings('.porto-loading-icon').length){ $('').insertAfter($button); } var data={ action: 'porto_add_to_cart', product_id: variation_id ? variation_id:product_id, quantity: quantity }; if(variation_id){ var $variations=$button.closest('form').find('.variations select'); if($variations.length){ $variations.each(function(){ var name=$(this).data('attribute_name'), val=$(this).val(); if(name&&val){ data[name]=val; }}); }} $(document.body).trigger('adding_to_cart', [$button, data]); $.ajax({ type: 'POST', url: theme.ajax_url, data: data, dataType: 'json', success: function(response){ $button.parent().removeClass('porto-ajax-loading'); if(!response){ return; } if(response.error&&response.product_url){ window.location=response.product_url; return; } if(wc_add_to_cart_params.cart_redirect_after_add==='yes'){ window.location=wc_add_to_cart_params.cart_url; return; } $(document.body).trigger('added_to_cart', [response.fragments, response.cart_hash, $button]); }}); }); } return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; $.extend(theme, { WooQtyField: { initialize: function(){ this.build() .events(); return this; }, qty_handler: function(){ var $obj=$(this); if($obj.closest('.quantity').next('.add_to_cart_button[data-quantity]').length){ var count=$obj.val(); if(count){ $obj.closest('.quantity').next('.add_to_cart_button[data-quantity]').attr('data-quantity', count); }} }, build: function(){ var self=this; $('div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)').addClass('buttons_added').append('').prepend(''); $('input.qty:not(.product-quantity input.qty)').each(function(){ var min=parseFloat($(this).attr('min')); if(min&&min > 0&&parseFloat($(this).val()) < min){ $(this).val(min); }}); $('input.qty:not(.product-quantity input.qty)').off('change', self.qty_handler).on('change', self.qty_handler); $(document).off('click', '.quantity .plus, .quantity .minus').on('click', '.quantity .plus, .quantity .minus', function(){ var $qty=$(this).closest('.quantity').find('.qty'), currentVal=parseFloat($qty.val()), max=parseFloat($qty.attr('max')), min=parseFloat($qty.attr('min')), step=$qty.attr('step'); if(!currentVal||currentVal===''||currentVal==='NaN') currentVal=0; if(max===''||max==='NaN') max=''; if(min===''||min==='NaN') min=0; if(step==='any'||step===''||step===undefined||parseFloat(step)==='NaN') step=1; if($(this).is('.plus')){ if(max&&(max==currentVal||currentVal > max)){ $qty.val(max); }else{ $qty.val(currentVal + parseFloat(step)); }}else{ if(min&&(min==currentVal||currentVal < min)){ $qty.val(min); }else if(currentVal > 0){ $qty.val(currentVal - parseFloat(step)); }} $qty.trigger('change'); }); return self; }, events: function(){ var self=this; $(document).ajaxComplete(function(event, xhr, options){ self.build(); }); return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; var duration=300; $.extend(theme, { WooVariationForm: { initialize: function(){ this.init().events(); return this; }, init: function(){ $('.variations_form').each(function(){ var $variation_form=$(this), $reset_variations=$variation_form.find('.reset_variations'); if($reset_variations.css('visibility')=='hidden') $reset_variations.hide(); }); return this; }, events: function(){ var self=this; $(document).on('check_variations', '.variations_form', function(event, exclude, focus){ var $variation_form=$(this), $reset_variations=$variation_form.find('.reset_variations'); if($reset_variations.css('visibility')=='hidden') $reset_variations.hide(); }); $(document).on('reset_image', '.variations_form', function(event){ var $product=$(this).closest('.product, .product-col'), $product_img=$product.find('div.product-images .woocommerce-main-image'); if($product.hasClass('product-col')){ $product_img=$product.find('div.product-image .inner img:first-child'); }else if($product.hasClass('porto-tb-item')){ $product_img=$product.find('.porto-tb-featured-image img').eq(0); } var o_src=$product_img.attr('data-o_src'), o_title=$product_img.attr('data-o_title'), o_href=$product_img.attr('data-o_href'), $thumb_img=$product.find('.woocommerce-main-thumb'), o_thumb_src=$thumb_img.attr('data-o_src'); var $image_slider=$product.find('.product-image-slider'), $thumbs_slider=$product.find('.product-thumbs-slider'), links; if($image_slider.length){ $image_slider.trigger('to.owl.carousel', [0, duration, true]); links=$image_slider.data('links'); } if($thumbs_slider.length){ $thumbs_slider.trigger('to.owl.carousel', [0, duration, true]); $thumbs_slider.find('.owl-item:eq(0)').trigger('click'); } if(o_src){ $product_img .attr('src', o_src) .attr('srcset', '') .attr('alt', o_title) .attr('href', o_href); $product_img.each(function(){ var elevateZoom=$(this).data('elevateZoom'); if(typeof elevateZoom!='undefined'){ elevateZoom.swaptheimage($(this).attr('src'), $(this).attr('src')); }}); if(theme.product_image_popup&&typeof links!='undefined'){ links[0].src=o_href; links[0].title=o_title; }} if(o_thumb_src){ $thumb_img.attr('src', o_thumb_src); }}); $(document).on('found_variation', '.variations_form', function(event, variation){ if(typeof variation=='undefined'){ return; } var $product=$(this).closest('.product, .product-col'), $image_slider=$product.find('.product-image-slider'), $thumbs_slider=$product.find('.product-thumbs-slider'), links; if($image_slider.length){ $image_slider.trigger('to.owl.carousel', [0, duration, true]); links=$image_slider.data('links'); } if($thumbs_slider.length){ $thumbs_slider.trigger('to.owl.carousel', [0, duration, true]); $thumbs_slider.find('.owl-item:eq(0)').trigger('click'); } var $shop_single_image=$product.find('div.product-images .woocommerce-main-image').length ? $product.find('div.product-images .woocommerce-main-image'):$('.single-product div.product-images .woocommerce-main-image'), productimage=$shop_single_image.attr('data-o_src'), imagetitle=$shop_single_image.attr('data-o_title'), imagehref=$shop_single_image.attr('data-o_href'), $shop_thumb_image=$product.find('.woocommerce-main-thumb'), thumbimage=$shop_thumb_image.attr('data-o_src'), variation_image=variation.image_src, variation_link=variation.image_link, variation_title=variation.image_title, variation_thumb=variation.image_thumb; if($product.hasClass('product-col')){ $shop_single_image=$product.find('div.product-image .inner img:first-child'); variation_image=variation.image.thumb_src; }else if($product.hasClass('porto-tb-item')){ $shop_single_image=$product.find('.porto-tb-featured-image img').eq(0); variation_image=variation.image.thumb_src; } if(!productimage){ productimage=$shop_single_image.attr('data-oi') ? $shop_single_image.attr('data-oi'):(( !$shop_single_image.attr('src')) ? '':$shop_single_image.attr('src')); $shop_single_image.attr('data-o_src', productimage); } if(!imagehref){ imagehref=(!$shop_single_image.attr('href')) ? '':$shop_single_image.attr('href'); $shop_single_image.attr('data-o_href', imagehref); } if(!imagetitle){ imagetitle=(!$shop_single_image.attr('alt')) ? '':$shop_single_image.attr('alt'); $shop_single_image.attr('data-o_title', imagetitle); } if(!thumbimage){ thumbimage=$shop_thumb_image.attr('data-oi') ? $shop_thumb_image.attr('data-oi'):(( !$shop_thumb_image.attr('src')) ? '':$shop_thumb_image.attr('src')); $shop_thumb_image.attr('data-o_src', thumbimage); } if(variation_image){ $shop_single_image.attr('src', variation_image); $shop_single_image.attr('srcset', ''); $shop_single_image.attr('alt', variation_title); $shop_single_image.attr('href', variation_link); $shop_thumb_image.attr('src', variation_thumb); if(theme.product_image_popup&&typeof links!='undefined'){ links[0].src=variation_link; links[0].title=variation_title; }}else{ $shop_single_image.attr('src', productimage); $shop_single_image.attr('srcset', ''); $shop_single_image.attr('alt', imagetitle); $shop_single_image.attr('href', imagehref); $shop_thumb_image.attr('src', thumbimage); if(theme.product_image_popup&&typeof links!='undefined'){ links[0].src=imagehref; links[0].title=imagetitle; }} $shop_single_image.each(function(){ var elevateZoom=$(this).data('elevateZoom'); if(typeof elevateZoom!='undefined'){ elevateZoom.swaptheimage($(this).attr('src'), $(this).attr('src')); }}); }); var porto_fb_update_trigger=null; $(document).on('found_variation reset_image', '.variations_form', function(event, variation){ if($(this).closest('.fancybox-inner').length&&$.fancybox){ $(window).off('resize.fb', $.fancybox.update); if(porto_fb_update_trigger){ theme.deleteTimeout(porto_fb_update_trigger); } porto_fb_update_trigger=theme.requestTimeout(function(){ $(window).on('resize.fb', $.fancybox.update); porto_fb_update_trigger=false; }, 160); }}); return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; $.extend(theme, { WooEvents: { initialize: function(){ this.events(); return this; }, events: function(){ var self=this; $('.wcml-switcher li').on('click', function(){ if($(this).parent().attr('disabled')=='disabled') return; var currency=$(this).attr('rel'); self.loadCurrency(currency); }); $('.woocs-switcher li').on('click', function(){ if($(this).parent().attr('disabled')=='disabled') return; var currency=$(this).attr('rel'); self.loadWoocsCurrency(currency); }); return self; }, loadCurrency: function(currency){ $('.wcml-switcher').attr('disabled', 'disabled'); $('.wcml-switcher').append('
  • '); var data={ action: 'wcml_switch_currency', currency: currency }; $.ajax({ type: 'post', url: theme.ajax_url, data: { action: 'wcml_switch_currency', currency: currency }, success: function(response){ $('.wcml-switcher').removeAttr('disabled'); $('.wcml-switcher').find('.loading').remove(); window.location=window.location.href; }}); }, loadWoocsCurrency: function(currency){ $('.woocs-switcher').attr('disabled', 'disabled'); $('.woocs-switcher').append('
  • '); var l=window.location.href; l=l.split('?'); l=l[0]; var string_of_get='?'; woocs_array_of_get.currency=currency; if(Object.keys(woocs_array_of_get).length > 0){ jQuery.each(woocs_array_of_get, function(index, value){ string_of_get=string_of_get + "&" + index + "=" + value; }); } window.location=l + string_of_get; }, removeParameterFromUrl: function(url, parameter){ return url .replace(new RegExp('[?&]' + parameter + '=[^&#]*(#.*)?$'), '$1') .replace(new RegExp('([?&])' + parameter + '=[^&]*&'), '$1'); }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ $(document).ready(function(){ if(typeof theme.WooQtyField!=='undefined'){ theme.WooQtyField.initialize(); } if(typeof theme.WooQuickView!=='undefined'){ theme.WooQuickView.initialize(); } if(typeof theme.WooEvents!=='undefined'){ theme.WooEvents.initialize(); } if(!('ontouchstart' in document)){ $('.mini-cart').on('hide.bs.dropdown', function(){ return false; }); }else{ $('#mini-cart .cart-head').on('click', function(e){ $(this).parent().toggleClass('open'); }); $('html,body').on('click', function(e){ if($('#mini-cart').hasClass('open')&&!$(e.target).closest('#mini-cart').length){ $('#mini-cart').removeClass('open'); }}); } $(document).on('tabactivate', '.woocommerce-tabs', function(e, ui){ var label=$(ui).attr('aria-controls'); var panel=$('[aria-labelledby="' + label + '"'); theme.refreshVCContent(panel); }); }); }).apply(this, [window.theme, jQuery]); (function(theme, $, undefined){ $(document).ready(function(){ theme.WooVariationForm.initialize(); if(typeof theme.initAsync=='function'){ theme.WooProductImageSlider.initialize(); porto_woocommerce_init(); }else{ $.when(theme.asyncDeferred).done(function(){ theme.WooProductImageSlider.initialize(); porto_woocommerce_init(); }); } if(typeof theme.salesPopup!=='undefined'&&!document.getElementById('yith-woocompare')&&window.Worker){ theme.salesPopup.initialize(); } $(window).on('vc_reload', function(){ porto_woocommerce_init(); $('.type-product').addClass('product'); }); $(document).on('click', '.porto-product-filters-toggle a', function(e){ e.preventDefault(); $(this).closest('.porto-product-filters-toggle').toggleClass('opened'); var $products_wrapper=$(this).closest('#main').find('.main-content').find('ul.products'), offset, $main=$(this).closest('#main').find('.main-content-wrap'); $main.toggleClass('opened'); if($main.hasClass('opened')){ offset=-1; }else{ offset=1; } if($products_wrapper.hasClass('grid')){ var cols_lg_index=0, cols_md_index=0, width_lg_index=0, width_md_index=0; for(var i=1; i <=8; i++){ if(!cols_lg_index&&$products_wrapper.hasClass('pcols-lg-' + i)){ cols_lg_index=i; if(i + offset >=1){ $products_wrapper.removeClass('pcols-lg-' + i); $products_wrapper.addClass('pcols-lg-' +(i + offset)); }} if(!cols_md_index&&$products_wrapper.hasClass('pcols-md-' + i)){ cols_md_index=i; if(i + offset >=1){ $products_wrapper.removeClass('pcols-md-' + i); if(offset===-1){ $products_wrapper.addClass('pcols-sm-' + i); } $products_wrapper.addClass('pcols-md-' +(i + offset)); }} if(!width_lg_index&&$products_wrapper.hasClass('pwidth-lg-' + i)){ width_lg_index=i; if(i + offset >=1){ $products_wrapper.removeClass('pwidth-lg-' + i); $products_wrapper.addClass('pwidth-lg-' +(i + offset)); }} if(!width_md_index&&$products_wrapper.hasClass('pwidth-md-' + i)){ width_md_index=i; if(i + offset >=1){ $products_wrapper.removeClass('pwidth-md-' + i); $products_wrapper.addClass('pwidth-md-' +(i + offset)); }} }} theme.requestTimeout(function(){ $(window).trigger('scroll'); $(document).find('.owl-carousel').each(function(e){ var $this=$(this); if($this.data('owl.carousel')){ $this.trigger('refresh.owl.carousel'); }}); $(document).find('.swiper-container').each(function(e){ var $this=$(this), $instance=$this.data('swiper'); if($instance){ $instance.update(); }}); }, 300); if($main.hasClass('opened')){ $.cookie('porto_horizontal_filter', 'opened'); }else{ $.cookie('porto_horizontal_filter', 'closed'); } theme.refreshStickySidebar(true); return false; }); if($.cookie&&'opened'==$.cookie('porto_horizontal_filter')&&$('#main .porto-products-filter-body').length&&!theme.isTablet()){ $('.porto-product-filters-toggle a').trigger('click'); $('#main .porto-products-filter-body [data-plugin-sticky]:not(.manual)').addClass('manual'); setTimeout(function(){ var $obj=$('#main .porto-products-filter-body [data-plugin-sticky].manual'), pluginOptions=$obj.data('plugin-options'); $obj.removeClass('manual').themeSticky(pluginOptions); theme.requestTimeout(function(){ $(window).trigger('scroll'); }, 100); }, 500); } $(document).on('click', '.porto-product-filters.style2 .widget-title', function(e){ e.preventDefault(); if($(this).next().is(':hidden')){ $('.porto-product-filters.style2 .widget-title').next().hide(); $('.porto-product-filters.style2 .widget').removeClass('opened'); $(this).next().show(); $(this).next().find('input[type="text"]:first-child').focus(); }else{ $(this).next().hide(); } $(this).parent().toggleClass('opened'); return false; }); $('body').on('click', function(e){ if(!$(e.target).is('.porto-product-filters')&&!$(e.target).is('.porto-product-filters *')){ $('.porto-product-filters.style2 .widget-title').next().hide(); $('.porto-product-filters.style2 .widget').removeClass('opened'); }}); $('body').on('click', '#login-form-popup form .woocommerce-Button', function(e){ var $this=$(this), $form=$this.closest('form'), isLogin=$this.hasClass('login-btn'); if(!isLogin&&!$this.hasClass('register-btn')){ isLogin=$form.hasClass('login'); } $form.find('#email').val($form.find('#username').val()); $form.find('p.status').show().text('Please wait...').addClass('loading'); $form.find('button[type=submit]').attr('disabled', 'disabled'); $.ajax({ type: 'POST', dataType: 'json', url: theme.ajax_url, data: $form.serialize() + '&action=porto_account_login_popup_' +(isLogin ? 'login':'register'), success: function(data){ $form.find('p.status').html(data.message.replace('//s', '')).removeClass('loading'); $form.find('button[type=submit]').removeAttr('disabled'); if(data.loggedin===true){ window.location.reload(); }} }); e.preventDefault(); }); var $ajax_tab_cache={}; $(document).on('click', '.porto-products.show-category .product-categories a', function(e){ e.preventDefault(); var $this=$(this), $form=$this.closest('.porto-products').find('.pagination-form'), id=$this.closest('.porto-products').attr('id'), group=[]; $(this).parent().siblings().removeClass('current'); $(this).parent().addClass('current'); if(typeof $this.data('sort_id')!='undefined'){ $form.find('input[name="orderby"]').val($this.data('sort_id')); group=$this.data('sort_id'); $form.find('input[name="category"]').val(''); } if(typeof $this.data('cat_id')!='undefined'){ if(typeof $this.data('sort_id')=='undefined'){ $form.find('input[name="orderby"]').val($form.find('input[name="original_orderby"]').val()); group=$form.find('input[name="original_orderby"]').val(); } if(typeof $form.data('original_cat_id')=='undefined'){ $form.data('original_cat_id', $form.find('input[name="category"]').val()); group=$form.find('input[name="category"]').val(); } if($this.data('cat_id')){ $form.find('input[name="category"]').val($this.data('cat_id')); group=$this.data('cat_id'); }else{ if($form.data('original_cat_id')){ $form.find('input[name="category"]').val($form.data('original_cat_id')); group=$form.data('original_cat_id'); }else{ $form.find('input[name="category"]').val(''); group=''; }} } var data=$form.serialize() + '&product-page=1&action=porto_woocommerce_shortcodes_products&nonce=' + js_porto_vars.porto_nonce; $this.closest('.porto-products').find('ul.products').trigger('porto_update_products', [data, '', $this, id, group]); }); $(document).on('click', '.porto-products .page-numbers a', function(e){ var $this=$(this), pagination_style, $shop_container=$this.closest('.porto-products').find('ul.products'), cur_page=$shop_container.data('cur_page'), max_page=$shop_container.data('max_page'), $form=$this.closest('.porto-products').find('.pagination-form'); e.preventDefault(); if($this.closest('.pagination').hasClass('load-more')){ if(!cur_page||!max_page||++cur_page > max_page){ return; } pagination_style='load_more'; $this.data('text', $this.text()); $this.text(js_porto_vars.loader_text); }else{ var url=new RegExp("product-page(=|/)([^(&|/)]*)", "i").exec(this.href); cur_page=url&&unescape(url[2])||""; pagination_style='default'; } var page_var=cur_page ? '&product-page=' + escape(cur_page):'', data=$form.serialize() + page_var + '&action=porto_woocommerce_shortcodes_products&nonce=' + js_porto_vars.porto_nonce; $shop_container.trigger('porto_update_products', [data, pagination_style, $this]); if('default'==pagination_style){ theme.scrolltoContainer($shop_container); }}); $(document).on('porto_update_products', 'ul.products', function(e, data, pagination_style, $obj, id, group){ var $this=$(this); if(undefined==$ajax_tab_cache[id]||-1==Object.keys($ajax_tab_cache[id]).indexOf(group)){ porto_ajax_load_products($this, data, pagination_style, $ajax_tab_cache, id, group); }else{ var response=$ajax_tab_cache[id][group]; $this.css('opacity', 0); $this.animate({ 'opacity': 1, }, 400, function(){ $this.css('opacity', ''); } ); porto_ajax_load_products_success($this, response, pagination_style); }}); }); $('.porto-onepage-category.show-products .category-section .sub-category').children('.cat-item').addClass('product-col'); $(document).on('click', '.porto-onepage-category .sub-category a', function(e){ var $this=$(this), category, data; category=new RegExp("cat-item-([^(|\")]*)", "i").exec($this.parent().attr('class')); category=category&&unescape(category[1])||""; if(category){ data=$this.closest('.category-details').find('.ajax-form').serialize() + '&action=porto_woocommerce_shortcodes_products&category_description=true&category=' + category + '&nonce=' + js_porto_vars.porto_nonce; e.preventDefault(); $this.closest('.category-section').find('.woocommerce > ul.products').trigger('porto_update_products', [data, '']); }}); var scrollspyData=null; $(document).on('porto_theme_init', function(){ if($('.porto-onepage-category.show-products').length&&typeof bootstrap!='undefined'){ document.body.style.position='relative'; scrollspyData=new bootstrap.ScrollSpy('body', { target: '.porto-onepage-category.show-products .category-list', offset: theme.StickyHeader.sticky_height + theme.adminBarHeight() + theme.sticky_nav_height + 20 }); var previousScrollTop=0, $loadObj; window.addEventListener('scroll', function(){ if(!$('.porto-onepage-category.show-products.ajax-load .category-section:not(.ajax-loaded)').length){ return; } var currentScrollTop=$(window).scrollTop(); if(previousScrollTop > currentScrollTop){ $loadObj=$('.porto-onepage-category.show-products.ajax-load .category-section:not(.ajax-loaded)').last(); }else{ $loadObj=$('.porto-onepage-category.show-products.ajax-load .category-section:not(.ajax-loaded)').eq(0); } previousScrollTop=$(window).scrollTop(); if(!$loadObj.closest('.porto-onepage-category').hasClass('loading')&&($loadObj.offset().top <=$(window).scrollTop() + $(window).innerHeight() * 0.7)){ $loadObj.trigger('porto_load_category_products'); }}, { passive: true }); } var $sticky_product_obj=$('.single-product .sticky-product'), is_elementor_editor=$(document.body).hasClass('elementor-editor-active'); var init_sticky_add_to_cart_fn=function($sticky_product_obj, is_elementor_editor){ if(is_elementor_editor&&elementorFrontend&&elementorFrontend.hooks){ elementorFrontend.hooks.addAction('frontend/element_ready/porto_cp_addcart_sticky.default', function($obj){ $sticky_product_obj=$('.single-product .sticky-product'); window.dispatchEvent(new Event('scroll')); }); } window.addEventListener('scroll', function(){ var scrollTop=$(window).scrollTop(), offset=theme.adminBarHeight() + theme.StickyHeader.sticky_height; if($('form.cart').length&&$('form.cart').offset().top + $('form.cart').height() / 2 <=scrollTop + offset){ $sticky_product_obj.removeClass('hide'); if(!$sticky_product_obj.hasClass('pos-bottom')){ $sticky_product_obj.css('top', offset); }}else{ $sticky_product_obj.addClass('hide'); }}, { passive: true }); $sticky_product_obj.find('.add-to-cart .button').on('click', function(e){ e.preventDefault(); $('.single-product form .quantity .qty').val($sticky_product_obj.find('.add-to-cart .qty').val()); $('.single-product form .single_add_to_cart_button').trigger('click'); }); $('.single-product .entry-summary .quantity').clone().prependTo('.single-product .sticky-product .add-to-cart'); var origin_img=$sticky_product_obj.find('.sticky-image img').data('oi') ? $sticky_product_obj.find('.sticky-image img').data('oi'):$sticky_product_obj.find('.sticky-image img').attr('src'), origin_price=$sticky_product_obj.find('.price').html(), origin_stock=$sticky_product_obj.find('.availability').html(), is_variation=false; $(document).on('found_variation reset_data', '.variations_form', function(e, obj){ if(obj){ is_variation=true; $sticky_product_obj.find('.sticky-image img').attr('src', obj.image_thumb ? obj.image_thumb:origin_img); $sticky_product_obj.find('.price').replaceWith(obj.price_html); $sticky_product_obj.find('.availability').html(obj.availability_html ? obj.availability_html:origin_stock); }else if(is_variation){ is_variation=false; $sticky_product_obj.find('.sticky-image img').attr('src', origin_img); $sticky_product_obj.find('.price').html(origin_price); $sticky_product_obj.find('.availability').html(origin_stock); }}); }; if($sticky_product_obj.length||is_elementor_editor){ init_sticky_add_to_cart_fn($sticky_product_obj, is_elementor_editor); }else{ $(document.body).on('porto_elementor_editor_init', function(){ var $sticky_product_obj=$('.single-product .sticky-product'), is_elementor_editor=$(document.body).hasClass('elementor-editor-active'); if($sticky_product_obj.length||is_elementor_editor){ init_sticky_add_to_cart_fn($sticky_product_obj, is_elementor_editor); }}); } if(1===$('.shop-loop-before').length&&$('.mobile-sidebar').length){ var porto_progress_obj=$('.porto-scroll-progress.fixed-under-header'), porto_progress_height=0; if(porto_progress_obj.length){ var flag=false; if(porto_progress_obj.is(':hidden')){ porto_progress_obj.show(); flag=true; } porto_progress_height=porto_progress_obj.height(); if(flag){ porto_progress_obj.hide(); }}else{ porto_progress_height=0; } var init_filter_sticky=function(){ var $obj=$('.shop-loop-before'); if(!$obj.prev('.filter-placeholder').length){ $('
    ').insertBefore($obj); } var $ph=$obj.prev('.filter-placeholder'), scrollTop=$(window).scrollTop(), offset=theme.adminBarHeight() + theme.StickyHeader.sticky_height + porto_progress_height - 1; if($('html.filter-sidebar-opened').length){ $ph.css('height', ''); return; } if($ph.offset().top <=scrollTop + offset){ $ph.css('height', $obj.outerHeight() + parseInt($obj.css('margin-bottom'))); $obj.addClass('sticky').css('top', offset); }else{ $ph.css('height', ''); $obj.removeClass('sticky').css('top', ''); }}; if(window.innerWidth < 992){ window.removeEventListener('scroll', init_filter_sticky); window.addEventListener('scroll', init_filter_sticky, { passive: true }); init_filter_sticky(); } var request_timer=null, old_win_width=window.innerWidth; $(window).on('resize', function(){ if(old_win_width!=window.innerWidth){ if(request_timer){ theme.deleteTimeout(request_timer); request_timer=false; } if(window.innerWidth < 992){ request_timer=theme.requestTimeout(function(){ window.removeEventListener('scroll', init_filter_sticky); window.addEventListener('scroll', init_filter_sticky, { passive: true }); $(window).trigger('scroll'); }, 100); }else{ window.removeEventListener('scroll', init_filter_sticky); $('.shop-loop-before').removeClass('sticky').css('top', '').prev('.filter-placeholder').css('height', ''); } old_win_width=window.innerWidth; }}); }}); $(document).on('click', '.porto-onepage-category.show-products .category-list .nav-link', function(e){ var $target=$($(this).attr('href')); if(!$target.length){ return; } e.preventDefault(); if($(this).closest('.porto-onepage-category').hasClass('ajax-load')&&!$target.hasClass('ajax-loaded')){ $target.trigger('porto_load_category_products'); } $target.closest('.porto-onepage-category').addClass('moving'); $('html, body').stop().animate({ scrollTop: $target.offset().top - theme.StickyHeader.sticky_height - theme.adminBarHeight() - theme.sticky_nav_height - 10 }, 600, 'easeOutQuad', function(){ $target.closest('.porto-onepage-category').removeClass('moving'); }); }); $(document).on('porto_load_category_products', '.category-section', function(){ var $target=$(this), cat_id=$target.attr('id').replace('category-', ''); if($target.closest('.porto-onepage-category').hasClass('loading')||$target.closest('.porto-onepage-category').hasClass('moving')||$target.hasClass('ajax-loaded')){ return false; } $target.css('min-height', 200); $target.addClass('yith-wcan-loading'); if(!$target.children('.porto-loading-icon').length){ $target.append(''); } $target.closest('.porto-onepage-category').addClass('loading'); var data=$target.closest('.porto-onepage-category').find('.ajax-form').serialize() + '&action=porto_woocommerce_shortcodes_products&category_description=true&category=' + cat_id + '&nonce=' + js_porto_vars.porto_nonce; $.ajax({ url: theme.ajax_url, data: data, type: 'post', success: function(response){ $target.addClass('ajax-loaded'); $target.append($(response).html()); $target.removeClass('yith-wcan-loading'); $(document).trigger('yith-wcan-ajax-filtered'); $(window).trigger('resize'); if(scrollspyData){ setTimeout(function(){ scrollspyData.refresh(); }, 300); } $target.closest('.porto-onepage-category').removeClass('loading'); }}); }); $('.cart-v2 .cart_totals .accordion-toggle.out').removeClass('out'); $(document).ajaxComplete(function(event, xhr, options){ $('.cart-v2 .cart_totals .accordion-toggle.out').each(function(){ if($($(this).attr('href')).length&&$($(this).attr('href')).is(':hidden')){ $(this).removeClass('collapsed'); $($(this).attr('href')).addClass('show'); }}); }); $('.porto_products_filter_form .btn-submit').on('click', function(e){ e.preventDefault(); var data=$(this).closest('form').serializeArray(), submit_data=''; for(var i in data){ var param=data[i]; if(param.value){ if(submit_data){ submit_data +='&'; } submit_data +=param.name + '=' + param.value; if('min_price'==param.name){ var max_price=$(this).closest('form').find('.porto_dropdown_price_range option:selected').data('maxprice'); if(max_price){ submit_data +='&max_price=' + max_price; }} }} location.href=$(this).closest('form').attr('action') + '?' + submit_data; }); if($('.wishlist_table.responsive').length){ $(window).on('resize', function(){ var media=window.matchMedia('(max-width: 768px)'), $wishlist_table=$('.wishlist_table.responsive'); if($wishlist_table.hasClass('traditional')){ if(media.matches){ $wishlist_table.addClass('mobile'); }else{ $wishlist_table.removeClass('mobile'); }} }); } if(js_porto_vars.pre_order){ var porto_pre_order={ init: function(){ this.$add_to_cart_btn=$('.product-summary-wrap .single_add_to_cart_button'); this.add_to_cart_label=this.$add_to_cart_btn.html(); $('.product-summary-wrap form.variations_form').on('show_variation', function(e, v, p){ if(v.porto_pre_order){ porto_pre_order.$add_to_cart_btn.html(v.porto_pre_order_label); if(v.porto_pre_order_date){ $(this).find('.woocommerce-variation-description').append(v.porto_pre_order_date); }}else{ porto_pre_order.$add_to_cart_btn.html(porto_pre_order.add_to_cart_label); }}).on('hide_variation', function(){ porto_pre_order.$add_to_cart_btn.html(porto_pre_order.add_to_cart_label); }); }}; if($('div.product.skeleton-loading').length){ $('div.product.skeleton-loading').on('skeleton-loaded', function(){ porto_pre_order.init(); }); }else{ porto_pre_order.init(); }} if($('#header .my-wishlist .wishlist-count').length){ $(document.body).on('added_to_wishlist removed_from_wishlist added_to_cart', function(e){ var $obj=$('#header .my-wishlist .wishlist-count'); if($obj.text()){ $.ajax({ type: 'POST', dataType: 'json', url: theme.ajax_url, data: { action: 'porto_refresh_wishlist_count', nonce: js_porto_vars.porto_nonce, }, success: function(response){ if(response||0===response){ $obj.addClass('count-updating').text(Number(response)); setTimeout(function(){ $obj.removeClass('count-updating'); }, 1000); }} }); }}); } if($(document.body).hasClass('woocommerce-cart')&&$('.wpcf7 .screen-reader-response').length){ $('.wpcf7 .screen-reader-response').attr('role', ''); } $('#dokan-store-listing-filter-form-wrap .store-search-input').on('keydown', function(e){ if(e.which&&event.which==13){ $(this).closest('form').find('#apply-filter-btn').trigger('click'); e.preventDefault(); }}); if($.fn.block){ var funcBlock=$.fn.block; $.fn.block=function(opts){ if(this.is('.woocommerce-checkout')){ this.append('
    '); } funcBlock.call(this, opts); } var funcUnblock=$.fn.unblock; $.fn.unblock=function(opts){ funcUnblock.call(this, opts); this.is('.processing')||(this.is('.woocommerce-checkout')&&this.children('.loader-container').remove()); return this; }} })(window.theme, jQuery); (function(theme, $){ 'use strict'; theme=theme||{}; if(!js_porto_vars.sales_popup) return; $.extend(theme, { salesPopup: { isCart: true, popupContainer: null, current: 0, products: [], worker: null, initialize: function(){ if($('.after-loading-success-message.style-3').length==0){ $('body').append('
    '); this.isCart=false; this.popupContainer=$('.after-loading-success-message.style-3'); }else{ this.popupContainer=$('.after-loading-success-message.style-3'); this.popupContainer.eq(0).stop().show(); } this.popupContainer.on('click', '.sales-close', function(){ var $obj=$(this).closest('.success-message-container'); $obj.removeClass('active'); setTimeout(function(){ $obj.slideUp(300, function(){ $obj.remove(); }); }, 350); }); this.build(); return this; }, appendContent: function(product){ var message=js_porto_vars.sales_popup.title, link=product.link, date=product.date, image=product.image, price=product.price, title=product.title; var $content=$('

    ' + message + '

    ' + '' + price + '

    ' + date + '

    ' + title + '
    ') this.popupContainer.prepend($content); setTimeout(function(){ $content.addClass('active'); }, 150); setTimeout(function(){ $content.find('.sales-close').trigger('click'); }, 4000); }, build: function(){ var self=this; self.worker=new Worker(js_porto_vars.sales_popup.themeuri + '/inc/lib/woocommerce-sales-popup/worker.js'); self.worker.onmessage=function(e){ if(e.data&&e.data.title){ self.appendContent(e.data); }}; self.worker.postMessage({ init: true, vars: js_porto_vars.sales_popup, ajaxurl: theme.ajax_url, nonce: js_porto_vars.porto_nonce }); return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; if(!js_porto_vars.compare_popup) return; $.extend(theme, { comparePopup: { isCart: true, popupContainer: null, $el: null, initialize: function($el){ this.$el=$el; if($('.after-loading-success-message.style-3').length==0){ $('body').append('
    '); this.isCart=false; this.popupContainer=$('.after-loading-success-message.style-3'); }else{ this.popupContainer=$('.after-loading-success-message.style-3'); this.popupContainer.eq(0).stop().show(); } this.popupContainer.on('click', '.compare-close', function(){ var $obj=$(this).closest('.success-message-container'); $obj.removeClass('active'); setTimeout(function(){ $obj.slideUp(300, function(){ $obj.remove(); }); }, 350); }); this.build(); return this; }, build: function(){ var self=this; if(js_porto_vars.compare_popup){ var self=this, isWishlistTable=$('.wishlist_table').length > 0 ? true:false, $product=isWishlistTable ? self.$el.closest('tr'):self.$el.closest('.product'), message=typeof js_porto_vars.compare_popup_title=='string' ? js_porto_vars.compare_popup_title:'', link=isWishlistTable ? $product.find('.product-thumbnail a:first-child').attr('href'):($product.find('.product-image>a:first-child').length > 0 ? $product.find('.product-image>a:first-child').attr('href'):'#'), image=isWishlistTable ? $product.find('.product-thumbnail img').attr('src'):($product.find('.product-inner .product-image img').length > 0 ? $product.find('.product-inner .product-image img').attr('src'):$product.find('.product-images .owl-item.active .img-thumbnail img').attr('src')), price=isWishlistTable ? $product.find('.product-price').html():$product.find('.price').html(), title=isWishlistTable ? $product.find('.product-name a').text():($product.find('.woocommerce-loop-product__title').length==1 ? $product.find('.woocommerce-loop-product__title').text():$product.find('.product_title').text()); if(!image&&$product.find('.product-image img').length){ image=$product.find('.product-image img').attr('src'); } if(!title&&$product.find('.product-image').length){ title=$product.find('.product-image').data('title'); } var $content=$('

    ' + message + '

    ' + '' + price + '
    ' + title + '
    '); self.popupContainer.prepend($content); setTimeout(function(){ $content.addClass('active'); }, 150); setTimeout(function(){ $content.find('.compare-close').trigger('click'); }, 4000); } return self; }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ theme=theme||{}; $.extend(theme, { porto_comapre_add_query_arg: function(key, value){ key=escape(key); value=escape(value); var s=document.location.search; var kvp=key + "=" + value; var r=new RegExp("(&|\\?)" + key + "=[^\&]*"); s=s.replace(r, "$1" + kvp); if(!RegExp.$1){ s +=(s.length > 0 ? '&':'?') + kvp; }; return s; }}); $(document).ready(function(){ $('body').on('click', '.wishlist_table a.compare.added', function(e){ e.preventDefault(); $('body').trigger('yith_woocompare_open_popup', { response: theme.porto_comapre_add_query_arg('action', yith_woocompare.actionview) + '&iframe=true' }); }); $(document) .off('click', '.product a.compare:not(.added)') .on('click', '.product a.compare:not(.added), .wishlist_table a.compare:not(.added)', function(e){ e.preventDefault(); if(typeof theme.comparePopup!='undefined'){ theme.comparePopup.initialize($(this)); } var button=$(this), data={ action: yith_woocompare.actionadd, id: button.data('product_id'), context: 'frontend' }, widget_list=$('.yith-woocompare-widget ul.products-list'); button.addClass('added'); $.ajax({ type: 'post', url: yith_woocompare.ajaxurl.toString().replace('%%endpoint%%', yith_woocompare.actionadd), data: data, dataType: 'json', success: function(response){ $('.yith-woocompare-open .compare-count').each(function(){ this.innerHTML=parseInt(this.innerHTML) + 1; }); var added_icon_html=''; if(button.data('added_icon')){ added_icon_html +=''; } button.attr('href', response.table_url) .html(!button.data('icon_pos') ? added_icon_html + yith_woocompare.added_label:yith_woocompare.added_label + added_icon_html); widget_list.html(response.widget_table); if(( typeof yith_woocompare!='undefined')&&('yes'==yith_woocompare.auto_open)){ button.trigger('click'); }} }).fail(function(){ button.removeClass('added'); }); }); }); $('body').on('click', 'a.yith-woocompare-open, .product a.compare.added, .wishlist_table a.compare.added', function(){ var scrollbarWidth=window.innerWidth - document.body.clientWidth; $('html').css({ 'overflow': 'hidden', 'margin-right': scrollbarWidth }); }); $('body').on('click', '.yith_woocompare_colorbox #cboxClose, #cboxOverlay', function(){ $('html').css({ 'overflow': '', 'margin-right': '' }); }); $('body').on('yith_woocompare_open_popup', function(){ setTimeout(function(){ if($('body').find('iframe').length){ var childWindow=$('body').find('#cboxLoadedContent iframe')[0].contentWindow; if(childWindow.jQuery){ childWindow.jQuery(childWindow).on('yith_woocompare_product_removed', function(){ $('.yith-woocompare-open .compare-count').each(function(){ this.innerHTML=Math.max(0, parseInt(this.innerHTML) - 1); }); }); }} }, 2000); }); })(window.theme, window.jQuery); })(); function porto_woocommerce_init($wrap){ 'use strict'; if(!$wrap){ $wrap=jQuery(document.body); } (function($){ if($.fn.themeWooWidgetToggle){ $(function(){ $wrap.find('.widget_product_categories, .widget_price_filter, .widget_layered_nav, .widget_layered_nav_filters, .widget_rating_filter, .widget-woof, .porto_widget_price_filter, #wcfmmp-store .widget.sidebar-box, #wcfmmp-store-lists-sidebar .sidebar-box').find('.widget-title').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeWooWidgetToggle(opts); }); }); } if($.fn.themeWooWidgetAccordion){ $(function(){ $wrap.find('.widget_product_categories, .widget_price_filter, .widget_layered_nav, .widget_layered_nav_filters, .widget_rating_filter, .widget-woof, #wcfmmp-store .widget.sidebar-box, #wcfmmp-store-lists-sidebar .sidebar-box').each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; $this.themeWooWidgetAccordion(opts); }); }); } if($.fn.themeWooProductsSlider){ $(function(){ var $direct_carousels=$wrap.find('.products-slider:not(.manual)').filter(function(){ if($(this).closest('.porto-carousel:not(.owl-loaded)').length){ return false; } return true; }); var $parent_carousel=$wrap.find('.porto-carousel:not(.owl-loaded)').filter(function(){ if($(this).find('.products-slider:not(.manual)').length){ return true; } return false; }); if($parent_carousel.length){ $parent_carousel.one('initialized.owl.carousel', function(){ $(this).find('.products-slider:not(.manual)').each(function(){ var $this=$(this); $this.themeWooProductsSlider($this.data('plugin-options')); }); }); } $direct_carousels.each(function(){ var $this=$(this), opts; var pluginOptions=$this.data('plugin-options'); if(pluginOptions) opts=pluginOptions; setTimeout(function(){ $this.themeWooProductsSlider(opts); }, 0); }); }); }})(jQuery); } function porto_woocommerce_variations_init($parent_obj){ 'use strict'; theme.requestTimeout(function(){ var form_variation=$parent_obj.find('form.variations_form:not(.vf_init)'); if(form_variation.length&&jQuery.fn.wc_variation_form){ form_variation.each(function(){ var data_a=jQuery._data(this, 'events'); if(!data_a||!data_a['show_variation']){ jQuery(this).wc_variation_form(); }}); }}, 100); } function porto_ajax_load_products($obj, data, pagination_style, $ajax_tab_cache, id, group){ 'use strict'; (function($){ if($obj.hasClass('loading')){ return; } $obj.addClass('loading'); if('load_more'!=pagination_style){ $obj.addClass('yith-wcan-loading'); if(!$obj.children('.porto-loading-icon').length){ $obj.append(''); }} if($ajax_tab_cache[id]==undefined){ $ajax_tab_cache[id]={};} $.ajax({ url: theme.ajax_url, data: data, type: 'post', success: function(response){ if($(response).length){ $ajax_tab_cache[id][group]=$(response).html(); }else{ $ajax_tab_cache[id][group]=''; } porto_ajax_load_products_success($obj, response, pagination_style); }, complete: function(){ $obj.removeClass('loading'); }}); })(jQuery); } function porto_ajax_load_products_success($obj, success, pagination_style){ 'use strict'; (function($){ if($obj.data('cur_page')&&$(success).find('ul.products').data('cur_page')){ $obj.data('cur_page', $(success).find('ul.products').data('cur_page')); } if('load_more'==pagination_style){ $obj.append($(success).find('ul.products').html()); }else{ if($obj.hasClass('owl-carousel')){ $obj.parent().css('min-height', $obj.parent().height()); } if($obj.hasClass('grid-creative')&&typeof $obj.attr('data-plugin-masonry')!='undefined'){ $obj.isotope('remove', $obj.children()); var newItems=$(success).find('ul.products').children(); $obj.append(newItems); $obj.isotope('appended', newItems); $obj.imagesLoaded(function(){ $obj.isotope('layout'); }); }else{ if($(success).length){ $obj.html($(success).find('ul.products').html()); }else{ $obj.html(''); }} } if($obj.hasClass('owl-carousel')&&$.fn.themeWooProductsSlider){ $obj.trigger('destroy.owl.carousel'); theme.requestTimeout(function(){ var pluginOptions=$obj.data('plugin-options'), opts; if(pluginOptions) opts=pluginOptions; $obj.data('__wooProductsSlider', '').themeWooProductsSlider(opts); $obj.parent().css('min-height', ''); }, 100); } if($obj.closest('.porto-products').find('.shop-loop-after').length){ if($(success).find('.shop-loop-after').length){ $obj.closest('.porto-products').find('.shop-loop-after').replaceWith($(success).find('.shop-loop-after')); }else{ $obj.closest('.porto-products').find('.shop-loop-after').remove(); }} if(typeof $obj.data('infinitescroll')!='undefined'){ var infinitescrollData=$obj.data('infinitescroll'); infinitescrollData.options.state.currPage=1; $obj.data('infinitescroll', infinitescrollData); } $obj.removeClass('yith-wcan-loading'); if('load_more'==pagination_style&&typeof $obj!='undefined'&&typeof $obj.data('text')!='undefined'){ $obj.text($obj.data('text')); } $(document).trigger("yith-wcan-ajax-filtered"); })(jQuery); };